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.
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
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
try specifying which rails environment you want to do this for, like:
RAILS_ENV=test rake db:setup
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With