I installed ActiveAdmin gem on an existing project, and I was able to Login on Localhost and following the documentation everything works perfectly on localhost. But on Heroku I can't login. After running heroku run rake db:seed
I can't login with the usual.
Email: [email protected]
Password: password
I am getting the following error
Invalid Email or password.
Any Idea on how to fix this?
I got it to work. The problem was in the db/seed.rb file. Looks like Heroku removed access for free users to access the console from the terminal. So heroku run rake or rails console
didn't work.
Earlier I didn't read the code in the seed file till the end. Here is it:
AdminUser.create!(email: '[email protected]', password: 'password', password_confirmation: 'password') if Rails.env.development?
This means the sample AdminUser created is meant to work only in development environment. It became a production environment the moment it was pushed on heroku. And since I cannot go into the rails console through Heroku. I had to add a new line in the seed file like so:
AdminUser.create!(email: '[email protected]', password: 'SomePassword', password_confirmation: 'SomePassword')
Now re-push this to heroku. And run heroku run rake db:seed
Now the new AdminUser details will work on your whateveryouwantyoursitetobe.com/admin
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments