Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps - Status | Demo | Docs | Install
  1. Cloudron Forum
  2. Discourse
  3. Discourse change root email error

Discourse change root email error

Scheduled Pinned Locked Moved Solved Discourse
discourseerror
3 Posts 2 Posters 1.0k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Online
    L Online
    LoudLemur
    wrote on last edited by nebulon
    #1
    SyntaxError ((irb):2: syntax error, unexpected ':', expecting `end')
    irb(main):001:0> u = User.find_by_usern...
             ^
    

    The Cloudron instructions to change root's email are here;

    https://docs.cloudron.io/apps/discourse/

    subvenS 1 Reply Last reply
    0
    • L LoudLemur
      SyntaxError ((irb):2: syntax error, unexpected ':', expecting `end')
      irb(main):001:0> u = User.find_by_usern...
               ^
      

      The Cloudron instructions to change root's email are here;

      https://docs.cloudron.io/apps/discourse/

      subvenS Offline
      subvenS Offline
      subven
      wrote on last edited by subven
      #2

      @LoudLemur works like expected. Please do not copy the whole line and not everything all at once.

      root@24b1add9-15ef-4255-9c41-818b8ab7b3dc:/app/code# sudo -E -u root bundle exec script/rails console
      fatal: not a git repository (or any of the parent directories): .git
      Loading production environment (Rails 6.1.6.1)
      irb(main):001:0> u = User.find_by_username("root")
      => #<User id: 1, username: "root", created_at: "2022-08-30 21:45:35.005212000 +0000", updated_at: "2022...
      irb(main):002:0> u.email = "admin@test.pro"
      => "admin@test.pro"
      irb(main):003:0> u.email_tokens.create(email: u.email)
      => #<EmailToken id: 6, user_id: 1, email: "admin@test.pro", confirmed: false, expired: false, created_at: "2022-08-30 21:48:23.999384866 +0000", updated_at: "2022-08-30 21:48:23.999384866 +0000", token_hash: "16536bc4c1bc61d44853bcdc8bb5dbe18833341fe1612d74bd...", scope: nil>
      irb(main):004:0> u.save!
      => true
      irb(main):005:0>
      

      First you enter the console and afterwards you paste the commands line by line starting with u = User.find_by_username("root")...

      L 1 Reply Last reply
      2
      • L LoudLemur marked this topic as a regular topic on
      • subvenS subven

        @LoudLemur works like expected. Please do not copy the whole line and not everything all at once.

        root@24b1add9-15ef-4255-9c41-818b8ab7b3dc:/app/code# sudo -E -u root bundle exec script/rails console
        fatal: not a git repository (or any of the parent directories): .git
        Loading production environment (Rails 6.1.6.1)
        irb(main):001:0> u = User.find_by_username("root")
        => #<User id: 1, username: "root", created_at: "2022-08-30 21:45:35.005212000 +0000", updated_at: "2022...
        irb(main):002:0> u.email = "admin@test.pro"
        => "admin@test.pro"
        irb(main):003:0> u.email_tokens.create(email: u.email)
        => #<EmailToken id: 6, user_id: 1, email: "admin@test.pro", confirmed: false, expired: false, created_at: "2022-08-30 21:48:23.999384866 +0000", updated_at: "2022-08-30 21:48:23.999384866 +0000", token_hash: "16536bc4c1bc61d44853bcdc8bb5dbe18833341fe1612d74bd...", scope: nil>
        irb(main):004:0> u.save!
        => true
        irb(main):005:0>
        

        First you enter the console and afterwards you paste the commands line by line starting with u = User.find_by_username("root")...

        L Online
        L Online
        LoudLemur
        wrote on last edited by
        #3

        @subven Thank you! I tried again

        1 Reply Last reply
        0
        • nebulonN nebulon marked this topic as a question on
        • nebulonN nebulon has marked this topic as solved on
        • girishG girish has marked this topic as unsolved on
        • girishG girish has marked this topic as solved on

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Bookmarks
        • Search