10
10

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.

Rails で"Is the server running locally and accepting connections on Unix domain socket "/tmp/.s.PGSQL.5432"?"

Last updated at Posted at 2016-03-30

⚠この方法ではデータベースのデータが削除されるのでご注意ください。

PC内で複数環境をつくっていたら、ぶっ壊れて、このようなエラーがでた。

[1] pry(main)> User.all
Hirb Error: could not connect to server: No such file or directory
        Is the server running locally and accepting
        connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

環境

  • macOS
  • Homebrew
  • Rails
  • PostgreSQL

解決方法

以下のコマンドで解決できました。

$ rm -rf /usr/local/var/postgres
$ initdb /usr/local/var/postgres

special thanks

10
10
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
10
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?