Mac OS Yosemite PostgreSQL

tom*_*rad 2 postgresql macos ruby-on-rails-4 osx-yosemite

我刚刚更新到Yosemite,我的postgres版本将无法正常工作,我从rails收到以下消息:

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"?
Run Code Online (Sandbox Code Playgroud)

即使我已经多次启动服务器了

pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
Run Code Online (Sandbox Code Playgroud)

我正在尝试取消postgSQL与自制程序的链接并重新安装,但我不知道它是否可行.

tom*_*rad 16

只需要取消链接postgreSQL

brew unlink postgresql
Run Code Online (Sandbox Code Playgroud)

然后

xcode-select --install
Run Code Online (Sandbox Code Playgroud)

最后

brew install postgresql

brew install openssl
Run Code Online (Sandbox Code Playgroud)

但是后来rails服务器没有工作:

rvm get stable
Run Code Online (Sandbox Code Playgroud)

看看我的current_ruby是哪个

rvm list

sudo rvm uninstall <current_ruby>

rvm install <current_ruby>
Run Code Online (Sandbox Code Playgroud)

现在创建一个postgredb初始化

initdb /usr/local/var/postgres9.3.5
Run Code Online (Sandbox Code Playgroud)

并启动您的服务器

pg_ctl -D /usr/local/var/postgres9.3.5 -l logfile start
Run Code Online (Sandbox Code Playgroud)

你完成了.