I was moving a large PostgreSQL database to a new machine.
After completing the operations I restarted the Rails application with the new database IP and I start getting this error:
ActiveRecord::NoDatabaseError We could not find your database
This is scary!
Fortunately I realized in a few minuets that the problem was that I modified the pg_hba.conf
but I forgot to restart. After the restart the error was solved.
Maybe a much more useful error would have been:
We cannot connect to the postgresql database.
For debugging you can use psql -h HOST -p PORT -U USER DB
(replacing the uppercase variables with the actual values of the database.yml
)