rake db:setup results in fe_sendauth no password supplied

szatan picture szatan · Aug 6, 2014 · Viewed 19.6k times · Source

When I run: rake db:setup

i get:

fe_sendauth: no password supplied

Couldn't create database for {"adapter"=>"postfresql", "encoding"=>"unicode",
"host"=>"localhost", "pool"=>5, "username"=>"my_user", "password"=>nil,  
"database"=>"my_db_test"}

-- enable_extension("plpgqsl")
rake aborted


Tasks: TOP => db:schema:load

My database.yml:

connection: &connection
adapter: postgresql
encoding: unicode
host:     localhost
pool: 5
username: my_user
password:

development:
  <<: *connection
  database: my_db_development

test: &test
  <<: *connection
  database: my_db_test

Already change my pg_hba.conf like in this question: Trying to set up postgres for ror app, getting error - fe_sendauth: no password supplied But it not help at all.

Answer

KJ_kaka picture KJ_kaka · Aug 14, 2014

It's a database connectivity issue.

Try to connect directly with the database that ur using. If it is asking password then you should use same password in database.yml file.

Check this link http://guides.rubyonrails.org/configuring.html#configuring-a-postgresql-database and Ruby on Rails: How can i edit database.yml for postgresql?

Hoping this links help you