Cannot run Puma directly

a year ago

tl;dr Either tmp/pids/ is being removed during build (as it is in git w/ a .keep file) or there's an issue with write access as Puma is unable to write tmp/pids/server.pid.

My Procfile has a web target of bundle exec puma -C config/puma.rb however this fails on Railway.app with the error

/usr/local/rvm/gems/ruby-3.2.3/gems/puma-6.4.2/lib/puma/launcher.rb:312:in `write': No such file or directory @ rb_sysopen - tmp/pids/server.pid (Errno::ENOENT)

I am able to work around it by running bundle exec rails server but this doesn't contain the same configurations as puma.rb.

2 Replies

a year ago

For context here is where I'm setting the custom start command.

Attachments


a year ago

The directory must have been missing as it is now working when .dockerignore contains

/tmp/pids/*
!/tmp/pids/.keep

Additionally I can confirm puma.rb is evaluated whether you use puma -C config/puma.rb or rails server. I'd guess rails server does some setup work (like mkdir -p tmp/pids perhaps) to then run puma -C config/puma.rb without any issue.


Cannot run Puma directly - Railway Help Station