Help us understand the problem. What is going on with this article?

bundler: failed to load command: puma

More than 1 year has passed since last update.

エラー内容

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
Esfahan
WEB系出身。現在はビッグデータの基盤構築、ETLなどがメイン。 / YouTubeで料理チャンネルやってます → https://www.youtube.com/channel/UCDnYBh2TtUAfQ0Z-tl0jTyw
https://www.youtube.com/channel/UCDnYBh2TtUAfQ0Z-tl0jTyw
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away