LoginSignup
1
0

More than 5 years have passed since last update.

postgresに接続できなくなったのでやったこと

Posted at

開発中、処理がくそ重くなってしまった原因を追求しようとしていたら、
processがkillできないほどに固まってしまったのでPC再起動

動くかなーって試してみたら・・・

$ rails s
=> Booting Puma
=> Rails 5.0.4 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
Puma starting in single mode...
* Version 3.7.1 (ruby 2.3.3-p222), codename: Snowy Sagebrush
* Min threads: 5, max threads: 5
* Environment: development
* Listening on tcp://localhost:3000
Use Ctrl-C to stop
Started GET "/" for ::1 at 2017-10-02 11:22:39 +0900

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"?
):

なんでpostgresがダメになってるんだよ・・・
最近よくpostgresが落ちる

毎回再インストールしてたけど、今回は再インストールしなくてもうまくいったので記録!

こちらを参考に
Postgres could not connect to server

みんながうまくいっているこのコメント

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

ダメだったw

その中のコメント

$ pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
pg_ctl: another server might be running; trying to start server anyway
server starting

動いた!

意味はわかっていないけど、これからはまずはこいつを試してみようw

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