When I attempt to run \"rake test\" on a local postgres database, it throws the above exception.
Here is my pg_hba.conf file: # Database administrative login by
I use Postgres App. Which is really great because you don't have to supply username and password in the default part of the database.yml
database.yml
default: &default
adapter: postgresql
encoding: unicode
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
development:
<<: *default
database: my-app_development
test:
<<: *default
database: my-app_test
production:
<<: *default
database: my-app_production
username: my-app
password: <%= ENV['MY-APP_DATABASE_PASSWORD'] %>
My problem: I changed the path and wasn't able to get postgres to work.
Solution: use the documentation to:
1) Uninstall the app
2) Stop the postgres process using this answer, which says to use sudo pkill -u postgres
3) Reinstall and start the app
Everything should work fine now, have a great day!
Note: Doing this also solves the problem Postgres.app port 5432 in use