Reputation: 71
When I run rails db:setup
, I get this error message:
FATAL: Ident authentication failed for user "rails_dev"
Couldn't create database for {"adapter"=>"postgresql", "encoding"=>"unicode", "pool"=>5, "database"=>"myapp_test", "username"=>"rails_dev", "password"=>"aqwe123", "host"=>"localhost", "port"=>5432}
rails aborted!PG::ConnectionBad: FATAL: Ident authentication failed for user "rails_dev"
/home/whitehat/.rvm/gems/ruby-2.4.0/gems/pg-0.21.0/lib/pg.rb:56:in 'initialize'
/home/whitehat/.rvm/gems/ruby-2.4.0/gems/pg-0.21.0/lib/pg.rb:56:in 'new'
/home/whitehat/.rvm/gems/ruby-2.4.0/gems/pg-0.21.0/lib/pg.rb:56:in 'connect
Upvotes: 0
Views: 631
Reputation: 71
After long search, I found the solution; the issue was in the PostgreSQL configuration file pg_hba.conf
. I changed the ident
method to MD5
and it worked.
local all all MD5
host all all 127.0.0.1/32 MD5
host all all ::1/128 MD5
Upvotes: 1