4
4

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 s -p $PORT -b $IPするとPG::ConnectionBadが出たとき

Last updated at Posted at 2017-08-15

状況

PG::ConnectionBad
could not connect to server: Connection refused Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
Screenshot_1.png

原因

  • postgresqlが動いていなかった

Screenshot_2.png

上のように $ psql を打ったときに「psql: could not connect to server: Connection refused」と出たのでpostgresqlが動いていないことがわかる。

対処

  1. $ sudo service postgresql start を実行する
  2. $ rails s -p $PORT -b $IP を実行する

Screenshot_3.png

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?