LoginSignup
1
0

More than 3 years have passed since last update.

PG::ConnectionBad: FATAL: the database system is starting up

Last updated at Posted at 2020-07-14

MacでRailsアプリ開発中に、rails db:migrateをしたらPG::ConnectionBad: FATAL: the database system is starting upが出た

現象

ターミナル

$ bundle exec rails db:migrate
rails aborted!
PG::ConnectionBad: FATAL:  the database system is starting up
/Users/jun/dic/Task-twitterclone/Rblog/vendor/bundle/ruby/2.6.0/gems/pg-1.2.3/lib/pg.rb:58:in `initialize'
...

解決策

$ rm /usr/local/var/postgres/postmaster.pid         // postmaster.pidを削除
$ brew services restart postgresql         // postgresql再起動

接続確認

$ psql -l
                                    List of databases
              Name               | Owner | Encoding | Collate | Ctype | Access privileges 
---------------------------------+-------+----------+---------+-------+-------------------
 FACEBOOK_EXAM_development       | jun   | UTF8     | C       | C     | 
 FACEBOOK_EXAM_test              | jun   | UTF8     | C       | C     | 
 GraphQL-app_development         | jun   | UTF8     | C       | C     | 

OK!

参考
https://qiita.com/hirocueki2/items/327dc6e87005edf622ad
https://blog.n-z.jp/blog/2020-01-08-homebrew-postgresql.html
https://qiita.com/opiyo_taku/items/2fc4bef8a6bfd468de6a

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