LoginSignup
2
1

More than 3 years have passed since last update.

Ruby on Rails 突然「http://localhost:3000に接続できなくなった場合の対処法

Last updated at Posted at 2020-05-06

ある日、いつも通りにサーバーを立ち上げ、(http://localhost:3000)
に接続しようとした際に、突然接続できなくなりました。
その際にコンソール上に出たエラー文はこちら。

PG::ConnectionBad - 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"?

私はあらゆるサイトを読み漁り、色々と試しました。
1.postgresのアップロード
2.linkファイルの再構築
3.servicesのインストール・起動
いずれを実行するも接続できませんでした。
しかし、とあるサイトで見つけた、

rm /usr/local/var/postgres/postmaster.pid

をターミナル上にて、実行してみたところ、見事解決しました!これはどうやら、前回正常にpostgresを終了させなかったことが原因で、本来残るはずがないファイルが残ってしまっていたようでした💧

2
1
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
2
1