哪里可以在Centos 6.4上查找PostgreSQL的sock文件?

我将postgresql9.1安装到我的Centos 6.4中。 我可以做psql template (以root身份)打开数据库控制台,但不能使用Rails rake db:create来创build数据库: FATAL: Ident authentication failed for user "root"

我的configuration如下:

 { "adapter"=>"postgresql", "host"=>"localhost", "encoding"=>"unicode", "username"=>"root", "pool"=>5, "database"=>"xxx_prod" } 

我猜Rails无法find袜子文件(.s.PGSQL.5432)。 所以我想明确指定它,但我不知道袜子文件的位置。 它应该在哪里? 我怎样才能find它?

问题不是袜子文件,而是(在我看来很糟糕)做出“ident”默认authenticationscheme的决定。

findpg_hba.conf文件并将“ident”改为“trust”或“md5”。

如果你想知道更多 – 考虑阅读这篇博文 。