25
7

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 1 year has passed since last update.

Postgresqlで`/bin/launchctl bootstrap gui/501` エラーが出た

Last updated at Posted at 2022-10-01

自分の覚書として書き残します。

環境

OS macOS 12.3.1
Ruby 3.0.1
Rails 6.1.6
Postgresql 14.5

経緯

$ rails db:create

を実行したところ、下記のエラーが発生。

ActiveRecord::ConnectionNotEstablished: 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"?

「ポスグレが起動していないのだろう(瞬殺だ)」と考えて

$ brew services start postgresql@14

を実行したら、こんなのが出ました orz

Bootstrap failed: 5: Input/output error
Try re-running the command as root for richer errors.
Error: Failure while executing; `/bin/launchctl bootstrap gui/501 /Users/username/Library/LaunchAgents/homebrew.mxcl.postgresql@14.plist` exited with 5.

なぜに bootstrap

解決策

結局、ポスグレをいったんストップさせて、再度起動させたら解決。

$ brew services stop postgresql@14
$ brew services start postgresql@14

理屈はまだわかっていませんが、この記事で救われる人が一人でもいらっしゃれば幸いです。

25
7
2

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?