如何运行`rails s`作为守护进程不能启动Puma?

问题描述 投票:2回答:3

当我运行rails s -e production -p 9292(正常情况)时,我得到:

=> Booting Puma
=> Rails 5.1.1 application starting in production on http://0.0.0.0:9292
=> Run `rails server -h` for more startup options
Puma starting in single mode...
* Version 3.8.2 (ruby 2.3.0-p0), codename: Sassy Salamander
* Min threads: 5, max threads: 5
* Environment: production
* Listening on tcp://0.0.0.0:9292
Use Ctrl-C to stop

当我运行rails s -d -e production -p 9292(作为守护进程)时,我得到:

=> Booting Puma
=> Rails 5.1.1 application starting in production on http://0.0.0.0:9292
=> Run `rails server -h` for more startup options

而已。我需要运行bundle exec puma -e production -p 9292 --pidfile tmp/pids/puma.pid -d来获得第二部分:

Puma starting in single mode...
...

我的Puma日志在哪里?我在production.log文件夹中看到一个空白的log,没有其他日志文件。

背景上下文:当我运行curl 0.0.0.0:9292rails作为守护进程后运行puma时,我得到错误An unhandled lowlevel error occurred. The application logs may have details.

ruby-on-rails puma
3个回答
2
投票
rails s -e production -p 9292 -d

0
投票

啊,看起来Puma在与capistrano一起使用时只关心RAILS_ENV。你可以使用RACK_ENV或使用-e吗?这应该工作:

RACK_ENV=production bundle exec puma -p 3000

要么

bundle exec puma -p 3000 -e production

here

希望能有所帮助


0
投票

to kill the server

杀死cat tmp/pids/server.pid

rails s -e production -p 9292 -d

© www.soinside.com 2019 - 2024. All rights reserved.