2014-10-17 125 views
2

我刚刚更新到优胜美地和我的Postgres的版本将无法正常工作,我从栏杆收到以下消息:的Mac OS的优胜美地的PostgreSQL

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从自制软件,并重新安装,但我不知道它是否会工作。

回答

16

就不得不取消链接PostgreSQL的

brew unlink postgresql 

然后

xcode-select --install 

最后

brew install postgresql 

brew install openssl 

但随后轨服务器没有那么工作:

rvm get stable 

要了解哪些是我current_ruby

rvm list 

sudo rvm uninstall <current_ruby> 

rvm install <current_ruby> 

现在创建初始化postgredb

initdb /usr/local/var/postgres9.3.5 

并启动服务器

pg_ctl -D /usr/local/var/postgres9.3.5 -l logfile start 

大功告成。

+0

有帮助。我不得不重新创建这个答案中提到的文件夹:http://stackoverflow.com/a/26001639/307308 – scarver2 2014-10-18 14:31:16

+0

你刚刚创造了我的生活!我错过了initdb步骤 – onetwopunch 2014-11-26 06:33:29

+0

运行'xcode-select --install'告诉我“xcode-select:error:命令行工具已经安装,使用”软件更新“安装更新” – 2015-08-21 19:53:59