Rails: FATAL - Peer authentication failed for user (PG::Error)

后端 未结 8 661
心在旅途
心在旅途 2020-12-04 04:22

I am running my development on Ubuntu 11.10, and RubyMine

Here is my development settings for the database.yml: which RubyMine created for me

develop         


        
相关标签:
8条回答
  • 2020-12-04 05:25

    You can go to your /var/lib/pgsql/data/pg_hba.conf file and add trust in place of Ident It worked for me.

    local   all all trust
    host    all 127.0.0.1/32    trust
    

    For further details refer to this issue Ident authentication failed for user

    0 讨论(0)
  • 2020-12-04 05:27

    I also faced this same issue while working in my development environment, the problem was that I left host: localhost commented out in the config/database.yml file.

    So my application could not connect to the PostgreSQL database, simply uncommenting it solved the issue.

    development:
      <<: *default
      database: database_name
    
      username: database_username 
    
      password: database_password
    
      host: localhost
    

    That's all.

    I hope this helps

    0 讨论(0)
提交回复
热议问题