これまで遭遇したエラーについて簡単にまとめていく。
今回は、
PostgresSQLのエラー
エラー文
1 2 3 4 |
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"? : |
今回の原因
Home brewをアップデートした際に、PostgresSQLのバージョンが上がったこと。
解決法
以下のコマンドでデータベースを初期化
1 |
$ rm -rf /usr/local/var/postgres |
1 |
$ initdb /usr/local/var/postgres |
注意
データベースを初期化するので、既に保存されていたデータが消える。
以上で終了