【发布时间】:2012-03-16 23:49:12
【问题描述】:
我遇到的问题描述在: Repairing Postgresql after upgrading to OSX 10.7 Lion 但没有解决。
产生错误的 Postgres 应用程序位于/usr/bin/psql,
但正确的是在
/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 文件后面的应用在哪里?
【问题讨论】:
-
OSX 10.7 附带 PostgreSQL (9.0.5) 客户端库和命令行实用程序。 OSX 10.7 Server 也有 PostgreSQL 服务器。
标签: ruby ruby-on-rails-3 osx-lion pg