当我运行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:9292
和rails
作为守护进程后运行puma
时,我得到错误An unhandled lowlevel error occurred. The application logs may have details.
rails s -e production -p 9292 -d
啊,看起来Puma在与capistrano一起使用时只关心RAILS_ENV
。你可以使用RACK_ENV
或使用-e吗?这应该工作:
RACK_ENV=production bundle exec puma -p 3000
要么
bundle exec puma -p 3000 -e production
见here
希望能有所帮助
杀死cat tmp/pids/server.pid
rails s -e production -p 9292 -d