最近对OSX Mavericks的升级 destruct 了我的Rails应用程序的数据库连接.
当我try 从数据库中提取时,服务器返回以下错误:
PG::ConnectionBad (could not connect to server: Connection refused
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Connection refused
Is the server running on host "localhost" (fe80::1) and accepting
TCP/IP connections on port 5432?
当我试着跑psql
英里时,我得到:
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
我try 过互联网上的许多解决方案.比如在我的数据库中重新安装pg gem并设置host:localhost.yml.My/usr/local/var/postgres/pg_hba.档案上写着:
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 trust
# IPv6 local connections:
host all all ::1/128 trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local replication RyanKing trust
#host replication RyanKing 127.0.0.1/32 trust
#host replication RyanKing ::1/128 trust
哪个psql返回:/usr/local/bin/psql
有什么解决办法吗?一些解决方案建议我需要将$PATH更改为以前安装的postgres,因为新版本的postgres将添加Mavericks.我如何找到它的位置?它很可能是用brew 软件安装的,但我不确定.