Puma restart fails on reboot using EC2 + Rails + Nginx + Capistrano

天大地大妈咪最大 提交于 2019-12-05 18:11:51

This is finally solved after a lot of research. It turns out the issue was threefold:

1) the proper environment was not being set when running the upstart script 2) the actual production puma.rb configuration file when using capistrano can be found in the home/deploy/deseov12/shared directory not in the /current/ directory 3) not demonizing the puma server properly

To solve these issues:

1) This line should be added to the start of the script in /etc/init/puma.conf and /home/deploy/puma.conf:

env RACK_ENV="production"

2) and 3) this line

exec bundle exec puma -C current/config/puma.rb

should be replaced with this one

exec bundle exec puma -C /home/deploy/deseov12/shared/puma.rb --daemon

After doing this, the puma server starts properly on reboot or new instance generation. Hope this helps someone avoid hours of troubleshooting.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!