To add a devise user on a Heroku site we combine two commands
Command 1: With devise a person can enter the following into their rails console to create a user: User.new(:email => "user@name.com", :password => 'password', :password_confirmation => 'password')
Command 2: To run commands in the Heroku terminal, simply go into local directory of the corresponding app and type heroku run [whatever you want to run]
So if we put those together we get the following, assuming that your user model is in fact called User:
- Change your directory to your app:
cd ~/yourapp - Enter into the rails console on Heroku with the following:
heroku run rails c - Run the create user code:
U=User.new(:email => "user@name.com", :password => 'password', :password_confirmation => 'password') - Then finally U.save
Finally, if you want to do this for a separate admin model, simply replace User in the instructions above with Admin (provided of course that’s what your separate admin model is called; if not adjust accordingly).
That’s it! You should be good to go!