4
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"?

Posted at

Sinatraでpostgresqlにつなごうとしていたら、下記のようなエラー。Rails等他のところでは繋げられているのになぜ?

bundle exec rake db:migrate
rake aborted!
PG::ConnectionBad: could not connect to server: No such file or directory
	Is the server running locally and accepting
	connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"?

http://taise.hatenablog.com/entry/2013/10/13/162546 によると
/var/pgsql_socket/.s.PGSQL.5432 という場所が違うらしい。

自分の場合は下記のようにしてOKでした。

$ sudo find / -name .s.PGSQL.5432
$ sudo mkdir -p /var/pgsql_socket
$ sudo ln -s /private/tmp/.s.PGSQL.5432 /var/pgsql_socket
4
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?