rake db:setup results in fe_sendauth no password supplied

20,650

Solution 1

My friend, I was have the same problem. My solution was added the credentials for each environment and enable the host in th value localhost..

like this:

development:
<<: *default
database: SM_development
username: user
password: xxxx

host: localhost

test:
<<: *default
database: SM_test
username: user
password: xxxxxx

production:
<<: *default
database: SM_production
username: user
password: xxxxxx

Solution 2

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

Solution 3

try specifying which rails environment you want to do this for, like:

RAILS_ENV=test rake db:setup

Solution 4

no password supplied means you have not supplied password to posgresql server from your database.yml.

Try to connect to posgresql server form pgadmin or terminal. Add same password (that you have used to login through terminal/pgadmin) to your database.yml.

Now try:

RAILS_ENV=TEST bundle exec rake db:setup

Share:
20,650
szatan
Author by

szatan

I am an independent artist looking for a major goal of an existance. I'am a slave of curiosity. Please to meet you! Hope you gues my name!.

Updated on July 09, 2022

Comments

  • szatan
    szatan almost 2 years

    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.