LoginSignup
0
0

More than 1 year has passed since last update.

[Rails] PG::ConnectionBad: local user with ID 502 does not existが出た時の対処法

Posted at

はじめに

データベースで操作でPG::ConnectionBad: local user with ID 502 does not existというエラーが発生した行った対処法を記事に残したいと思います。

エラーの発生

以下のコマンドを実行した時に

コンソール
bundle exec rails db:migrate:status

このようなエラー文が出ました

=> Running via Spring preloader in process 74769
rake aborted!
ActiveRecord::ConnectionNotEstablished: local user with ID 502 does not exist
/Users/mouriyuka/runteq/pf/shere-lerning-video/vendor/bundle/ruby/3.0.0/gems/activerecord-
6.1.5/lib/active_record/connection_adapters/postgresql_adapter.rb:83:in `rescue in new_client'
/Users/mouriyuka/runteq/pf/shere-lerning-video/vendor/bundle/ruby/3.0.0/gems/activerecord-
....

対処法

springが悪さをしているようだったため、stopしました

コンソール
bundle exec spring stop
=> Spring stopped.

その後、起動するようになりました!

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