我想在我的mac(10.7 Lion)上爲rails應用程序本地獲取postgres設置。試圖在OSX上設置postgres
我安裝postgresapp並啓動它,現在我的狀態欄中有一頭大象告訴我postgres正在運行。
我可以得到它:
psql -h localhost
但是當我只需運行psql
我得到這個錯誤:
psql: could not connect to server: Permission denied Is the server running locally and accepting connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"?
我把這個:
PATH="/Applications/Postgres.app/Contents/MacOS/bin:$PATH"
在~/.bashrc
和開了一個新的終端。但沒有骰子。
當我運行which psql
我得到/usr/bin/psql
不是真的知道該怎麼做..我還是很新的Unix系統。我應該符號鏈接/usr/bin/psql
到/Applications/Postgres.app/Contents/MacOS/bin/psql
?
哪裏另一個'psql'來自'/ usr/bin /'中的'psql'嗎?預裝Mac OS X?來自不同的PostgreSQL包? – 2012-08-16 02:58:30
@CraigRinger我會認爲它已經預裝了。 – 2012-08-16 03:14:22
'/ Applications/Postgres.app/Contents/MacOS/bin'中是否有psql可執行文件?它應該在那裏。如果你嘗試運行那個(指定路徑),會發生什麼? – dezso 2012-08-16 06:30:51