0

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

1
  • Can you paste your database.yml here? Commented Aug 26, 2017 at 9:55

1 Answer 1

1

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
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.