LoginSignup
10
9

More than 3 years have passed since last update.

bundler: failed to load command: puma

Posted at

エラー内容

pumaを起動するとbundler: failed to load command: pumaと言われる。

$ bundle exec puma -t 5:5 -p 3000 -e development -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)>'

解決策

以下2つのディレクトリを作成する。

$ mkdir tmp/sockets
$ mkdir tmp/pids

起動した。

$ bundle exec puma -t 5:5 -p 3000 -e development -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
10
9
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
10
9