加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby – 升级到OSX 10.7.3 Lion后修复Postgresql

发布时间:2020-12-17 07:09:36 所属栏目:百科 来源:网络整理
导读:我有以下问题: Repairing Postgresql after upgrading to OSX 10.7 Lion 但没有得到解决. 生成错误的Postgres应用程序位于/usr/bin/psql, 但是正确的是 /Library/PostgreSQL/9.1/bin/psql. 当我在.bash_profile(甚至在/ etc / paths)中添加后者到我的路径时
我有以下问题:
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文件后面的位置?

解决方法

运行find / -name .s.PGSQL.5432 -ls之后,我注意到结果是:

47366187 0 srwxrwxrwx 1 postgres wheel 0 Dec 3 15:15 /private/tmp/.s.PGSQL.5432

请注意,PGSQL套接字文件是/private/tmp/.s.PGSQL.5432

使用上面的建议(但稍微修改一下),我这样做了:

sudo ln -s /private/tmp /var/pgsql_socket

重新启动终端,它工作.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读