How to change user email if email account has been deleted

I deleted my email account with a certain mail service. Now when changing email in preferences, it says to check the confirmation email sent to that address, now inaccessible. Even as the site administrator when changing the email I get the same message.

What to do in this case? This must be a common enough occurrence.

1 Like

It needs to be done via the rails console, there’s a walkthrough here:

3 Likes

The other way to do this, if you hate Rails and there are multiple admins, is have the other admin take away your admin rights, then you change your address, then they give you admin back.

3 Likes

@awesomerobot thanks so much. Works well.

Just one edit, you need two separate commands:

# ./launcher enter app
# rails c

These were conflated in the post. Confused me for a while.

1 Like

Or you can do this in one line, as follows:

docker exec -it app rails c

This is how I generally run the rails console when I have a quick query to do or to check some object, etc.

To make things easier, I have the following alias set up on my system (except the name of app is different for us):

alias railsc='docker exec -it app rails c'

In this manner, we can easily enter the rails console by typing railsc on the command line outside the container.

ubuntu:/home/neo# railsc
[1] pry(main)> User.count
=> 139160
[2] pry(main)> Topic.count
=> 380629
[3] pry(main)> Post.count
=> 1034861
[4] pry(main)> SiteSetting.count
=> 157
[5] pry(main)> SiteSetting.force_https
=> true

Don’t forget to change the name to match your container in your alias setup.

HTH.

2 Likes