我有 在升级到 OSX 10.7 Lion 后修复 Postgresql中描述的问题, 但没有得到解决。
产生错误的 Postgres 应用程序是 at /usr/bin/psql
,但正确的是 at
/Library/PostgreSQL/9.1/bin/psql
。
.bash_profile
当我在(或什至)中将后者添加到我的路径时/etc/paths
,卸载并安装 PG gem,然后我仍然收到错误:
.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.2.1/lib/active_record/connection_adapters/postgresql_adapter.rb:1161:in `initialize': could not connect to server: Permission denied (PG::Error) Is the server running locally and accepting
我尝试了几次,也可以选择:
-- --with-pg-config=/Library/PostgreSQL/9.1/bin/pg_config
任何想法?
编辑:
在阅读了更多帖子(如http://www.iainlbc.com/2011/10/osx-lion-postgres-could-not-connect-to-database-postgres-after-homebrew-installation)后,我刚刚做了下列的:
sudo ln -s /private/tmp/.s.PGSQL.5432 /var/pgsql_socket/
它奏效了。我完全不知道为什么。我有两个 Postgres 安装吗?文件后面的应用程序在哪里/usr/bin/psql
?