2012-07-18 54 views
0

我正在關注如何在iOS上使用heroku的教程Heroku。該示例使用postgres數據庫來存儲圖像和地理位置。我在Lion OSX上下載了postgres應用程序,它說postgres服務器運行正常。現在我停留在這一步:使用Postgres的Heroku iOS教程

Update the config/database.yml file to reference the correct database user and password for >the development and test environments. Then create the local development database and run the >migrations.

$ bundle exec rake db:create db:migrate 
== CreatePhotos: migrating =========== 
-- create_table(:photos) 
... 

但我收到以下錯誤:

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"? ....

我做了什麼錯?我嘗試使用createdb命令手動創建postgres數據庫,但我遇到了相同的連接錯誤。

+0

什麼是您在database.yml中爲套接字設置的位置?例如:'socket:/tmp/postgres.sock' – 2012-07-19 03:48:14

+0

我能夠修復它,它接合了我在MacOSX Lion上安裝Postgres時遇到的麻煩。這個問題是已知的,並且安裝的幾個解決方案在線。 – alandalusi 2012-07-19 07:36:51

回答

0

當PostgreSQL未在指定的套接字上偵聽時發生此錯誤。原因可能包括(以檢查)

  1. 的PostgreSQL安裝不正確

  2. 的PostgreSQL停止或沒有運行。

  3. PostgreSQL在不同的套接字或不同的目錄中偵聽。這些信息在postgresql.conf中指定。