Rails: could not connect to database postgres: FATAL: Peer authentication failed for user "username"

/var/lib/pgsql/9.2/data/pg_hba.conf

 打开之后找到

local   all             postgres/all                                peer

 改成

local   all             postgres                                trust

 保存之后重新加载文件

sudo /etc/init.d/postgresql reload

 

你可能感兴趣的:(Authentication)