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: 'admin@example.com', 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: 'admin@whateveryouwantyoursitetobe.com', 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