posgreを利用しているrailsプロジェクトでタイトルのエラー発生
下記の手順でエラーの解消を行ったところ問題なくposgreにつなげることができました
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | # ログを確認するために移動 cd /usr/local/var/log/ # ログ確認 vi postgres.log 2020-05-17 12:05:33.296 JST [20848] FATAL: lock file "postmaster.pid" already exists 2020-05-17 12:05:33.296 JST [20848] HINT: Is another postmaster (PID 488) running in data directory "/usr/local/var/postgres"? # .pidを削除 cd /usr/local/var/postgres rm postmaster.pid # 最後にposgreを再起動 brew services restart postgresql |
参考記事
PG::ConnectionBad – could not connect to server: Connection refused