Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No such file or directory @ rb_sysopen - tmp/pids/puma.pid

I'm trying to start puma, but at the last step it fails like this:

16:38:09 web.1  | /home/ramonpm/.rvm/gems/ruby-2.2.7/gems/puma-3.9.1/lib/puma/launcher.rb:130:in `initialize': No such file or directory @ rb_sysopen - tmp/pids/puma.pid (Errno::ENOENT)
16:38:09 web.1  |   from /home/ramonpm/.rvm/gems/ruby-2.2.7/gems/puma-3.9.1/lib/puma/launcher.rb:130:in `open'
16:38:09 web.1  |   from /home/ramonpm/.rvm/gems/ruby-2.2.7/gems/puma-3.9.1/lib/puma/launcher.rb:130:in `write_pid'
16:38:09 web.1  |   from /home/ramonpm/.rvm/gems/ruby-2.2.7/gems/puma-3.9.1/lib/puma/launcher.rb:103:in `write_state'
16:38:09 web.1  |   from /home/ramonpm/.rvm/gems/ruby-2.2.7/gems/puma-3.9.1/lib/puma/single.rb:92:in `run'
16:38:09 web.1  |   from /home/ramonpm/.rvm/gems/ruby-2.2.7/gems/puma-3.9.1/lib/puma/launcher.rb:174:in `run'
16:38:09 web.1  |   from /home/ramonpm/.rvm/gems/ruby-2.2.7/gems/puma-3.9.1/lib/puma/cli.rb:77:in `run'
16:38:09 web.1  |   from /home/ramonpm/.rvm/gems/ruby-2.2.7/gems/puma-3.9.1/bin/puma:10:in `<top (required)>'
16:38:09 web.1  |   from /home/ramonpm/.rvm/gems/ruby-2.2.7/bin/puma:23:in `load'
16:38:09 web.1  |   from /home/ramonpm/.rvm/gems/ruby-2.2.7/bin/puma:23:in `<main>'
16:38:09 web.1  |   from /home/ramonpm/.rvm/gems/ruby-2.2.7/bin/ruby_executable_hooks:15:in `eval'
16:38:09 web.1  |   from /home/ramonpm/.rvm/gems/ruby-2.2.7/bin/ruby_executable_hooks:15:in `<main>'
16:38:09 web.1  | exited with code 1
16:38:09 system | sending SIGTERM to all processes

Couldn't find a solution somewhere else, they are all related to different things.

like image 658
Ramon Marques Avatar asked Oct 17 '18 19:10

Ramon Marques


2 Answers

Could solve it manually creating the necessary folders, then the server process could create the pid file.

mkdir -p tmp/pids
like image 179
Ramon Marques Avatar answered Oct 21 '22 01:10

Ramon Marques


This error happened when I first added puma.rb file by rails app:update to rails 5.2 for a Heroku app.

# Specifies the `pidfile` that Puma will use.
pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" }

Resolved by adding tmp/pids/.keep file,

$ touch tmp/pids/.keep

And updating .gitignore file as follows.

# Ignore all logfiles and tempfiles.
/log/*
/tmp/*
!/log/.keep
!/tmp/.keep

# Ignore pidfiles, but keep the directory.
/tmp/pids/*
!/tmp/pids/
!/tmp/pids/.keep
like image 27
kangkyu Avatar answered Oct 21 '22 00:10

kangkyu