【发布时间】:2013-01-20 18:08:23
【问题描述】:
使用 Postgres 9.2.2,当我尝试启动 rails 服务器或运行 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"?
这个命令,当运行时:
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
说服务器正在启动,但是当我去检查进程时,没有 postgres 进程正在运行
我的路径是正确的
$ which psql
/usr/local/bin/psql
$ which pg_ctl
/usr/local/bin/pg_ctl
如果我运行这个命令:
initdb /usr/local/var/postgres -E utf8
它将连接到套接字....但它也需要我删除我的数据库,这非常令人沮丧。每次重新启动时似乎都会发生这种情况。
使用
- Postgres 9.2.2
- 酿造
- OSX 山狮
我在堆栈溢出时发现了类似的线程,但似乎没有一个解决方案有效。
【问题讨论】:
-
这似乎是 OSX 上的常见问题,与升级和打包有关。看这里可能会回答:stackoverflow.com/a/8482546/905902BTW:如果服务器没有启动,它在日志中说什么? BTW2:你改变了位置/目录吗?
-
你可能想试试postgresapp.com
标签: ruby-on-rails database ruby-on-rails-3 postgresql unix