0
0

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.

【Rails】bundler: failed to load command: puma 解消法

Last updated at Posted at 2022-08-20

状況

bundle exec puma -C config/puma.rbを実行したところ以下のとおりエラーとなりました。

ターミナル
$ bundle exec puma -C config/puma.rb
Puma starting in single mode...
* Version 3.12.1 (ruby 2.5.1-p57), codename: Llamas in Pajamas
* Min threads: 5, max threads: 5
* Environment: development
* Listening on tcp://0.0.0.0:3000
bundler: failed to load command: puma (/PRJ_ROOT/vendor/bundle/ruby/2.5.0/bin/puma)
Errno::ENOENT: No such file or directory @ rb_sysopen - tmp/pids/server.pid
  /PRJ_ROOT/vendor/bundle/ruby/2.5.0/gems/puma-3.12.1/lib/puma/launcher.rb:133:in `initialize'
  /PRJ_ROOT/vendor/bundle/ruby/2.5.0/gems/puma-3.12.1/lib/puma/launcher.rb:133:in `open'
  /PRJ_ROOT/vendor/bundle/ruby/2.5.0/gems/puma-3.12.1/lib/puma/launcher.rb:133:in `write_pid'
  /PRJ_ROOT/vendor/bundle/ruby/2.5.0/gems/puma-3.12.1/lib/puma/launcher.rb:106:in `write_state'
  /PRJ_ROOT/vendor/bundle/ruby/2.5.0/gems/puma-3.12.1/lib/puma/single.rb:103:in `run'
  /PRJ_ROOT/vendor/bundle/ruby/2.5.0/gems/puma-3.12.1/lib/puma/launcher.rb:186:in `run'
  /PRJ_ROOT/vendor/bundle/ruby/2.5.0/gems/puma-3.12.1/lib/puma/cli.rb:80:in `run'
  /PRJ_ROOT/vendor/bundle/ruby/2.5.0/gems/puma-3.12.1/bin/puma:10:in `<top (required)>'
  /PRJ_ROOT/vendor/bundle/ruby/2.5.0/bin/puma:23:in `load'
  /PRJ_ROOT/vendor/bundle/ruby/2.5.0/bin/puma:23:in `<top (required)>'

解消法

以下のコマンドを実行してディレクトリを作成することで解消しました。

ターミナル
$ mkdir -p ./tmp/sockets

起動した。

$ bundle exec puma -C config/puma.rb
Puma starting in single mode...
* Version 3.12.1 (ruby 2.5.1-p57), codename: Llamas in Pajamas
* Min threads: 5, max threads: 5
* Environment: development
* Listening on tcp://0.0.0.0:3000
Use Ctrl-C to stop
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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?