2016-06-28 207 views
1

我試圖運行我的rails項目,但它不斷下降,因爲它取決於postgres要運行。當我嘗試啓動postgres時,它一直說它已經在運行(或者端口已被佔用)。我檢查活動監視器,有〜6 postgres進程運行,當我試圖終止/強制退出進程,他們只是再次出現...停止postgres進程重新啓動 - mac

不知道如何解決這個問題。運行postgres -D /usr/local/var/postgres

實際的錯誤:

LOG: could not bind IPv6 socket: Address already in use HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry. LOG: could not bind IPv4 socket: Address already in use HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry. WARNING: could not create listen socket for "localhost" FATAL: could not create any TCP/IP sockets

,當我試圖阻止的Postgres與pg_ctl -D /usr/local/var/postgres stop -s -m fast,我得到這個錯誤:

pg_ctl: PID file "/usr/local/var/postgres/postmaster.pid" does not exist Is server running?

+0

嘗試通過進程ID殺死Postgres的過程 – adil

+0

@adil試過了,一個新的進程剛剛取代它 –

回答

1

我結束了從頭開始:

  • 通過自制軟件卸載postgres(brew uninstall postgresql
  • 卸載的Postgres雖然卸載程序(/庫/ PostgreSQL的/ /卸載)
  • 通過文件系統刪除的Postgres(刪除文件夾:/資源庫/ PostgreSQL的/)

然後只是做一個自制安裝:

brew install postgresql 

並手動啓動postgres。

0

1:

pg_ctl -D /usr/local/var/postgres stop -s -m fast 

2:

brew services stop postgresql