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


  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
Skins
  • Light
  • 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

Cloudron Forum

Apps | Demo | Docs | Install

Discourse change root email error

Scheduled Pinned Locked Moved Solved Discourse
discourseerror
3 Posts 2 Posters 146 Views
    • 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 Offline
    L Offline
    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
  • subvenS Offline
    subvenS Offline
    subven
    replied to LoudLemur on last edited by subven
    #0

    @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
  • subvenS Offline
    subvenS Offline
    subven
    replied to LoudLemur 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
  • L Offline
    L Offline
    LoudLemur
    replied to subven 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

  • Login

  • Don't have an account? Register

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