2012-01-24 42 views
0

在運行我的Rails應用程序我正在follwoing錯誤PG錯誤的Rails應用程序

PGError (could not connect to server: Connection refused 
     Is the server running locally and accepting 
     connections on Unix domain socket "/tmp/.s.PGSQL.1024"? 
): 

我試着命令

/etc/init.d/postgresql restart 

我得到以下幾點:

Stopping postgresql service:        [FAILED] 
Initializing database: mkdir: cannot create directory `/var/lib/pgsql/data/pg_log': File exists 
                  [FAILED] 
Starting postgresql service:        [FAILED] 

回答

0

這個錯誤與Ruby on Rails沒有關聯。您應該檢查PostgreSQL日誌目錄的權限。您還需要確保您以root身份啓動Postgres守護進程:

sudo /etc/init.d/postgresql start