状況
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