2014-10-17 124 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