无法连接到服务器:"/ var/run/postgresql/.s.PGSQL.5432"?

may*_*ues 10 ruby postgresql ruby-on-rails heroku

我在Ruby On Rails中有一个带有postgresql数据库的简单网页,但是当我运行服务器时我有这个错误,我不知道我这样做.我使用postgresql,因为heroku需要aplication在postgresql中.

我在ubuntu 13.10工作

错误是:

PG :: ConnectionBad无法连接到服务器:没有这样的文件或目录服务器是否在本地运行并接受Unix域套接字"/var/run/postgresql/.s.PGSQL.5432"上的连接?

我需要帮助

谢谢

ram*_*lli 3

只需创建一个像这样的软链接,这对我有用

$ sudo ln -s /tmp/.s.PGSQL.5432 /var/run/postgresql/.s.PGSQL.5432
Run Code Online (Sandbox Code Playgroud)

了解更多信息