使用领班启动时,Rails服务器挂起 [英] Rails server hangs when started with foreman
本文介绍了使用领班启动时,Rails服务器挂起的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是我的Procfile的样子:
Here's what my Procfile looks like:
web: bundle exec rails server thin -p $PORT -e $RACK_ENV
worker: bundle exec rake jobs:work
我打算添加一个辅助进程,因为我希望运行一些后台作业。我正在按照这些说明
I intend to add a worker process because I wish to run some background jobs. I'm following these instructions
这是我注意到的:
- 如果工人是单独启动的,则不会遇到任何问题。
- 当我将第二行保留在Procfile中并且不进行任何更改时,rails服务器会处理几个请求并在此之后挂起
- 如所述这里,我添加了
STDOUT.sync = true
到config / environments / development.rb并在rails控制台中进行了验证。没用。 - 将log / development.log尾巴化,并将其与由领班输出到shell的东西进行比较,并注意到两者都匹配了两个请求,然后领班停止打印出东西到外壳-下一个请求将挂起
- 我使用foreman.pkg更新了工头,如前所述此处,并与[6]进行了验证
- 有人提到在这里,这可能是由于调试错误的语句引起的。我没有使用调试器,而且我的Gemfile.lock中没有撬动的宝石或ruby-debug的宝石。
- 我相信症状类似于与此相关的未答复的问题
- No problems encountered if the worker is started separately.
- When I keep the second line in the Procfile and don't not change anything else, the rails server serves a couple of requests and hangs after that
- As mentioned here , I've added
STDOUT.sync = true
to config/environments/development.rb and verified the same in the rails console. Did not work. - Tailed log/development.log and compared it against the stuff that foreman outputted to the shell and noticed that both matched for a couple of requests and then foreman stopped printing out stuff to the shell - the next request would then hang
- I updated foreman using foreman.pkg as mentioned here and verified the same with [6]
- It was mentioned here that this might be caused due to a stray debug statement. I'm not using the debugger and I do not have the pry gem or the ruby-debug gem in my Gemfile.lock
- I believe the symptoms are similar to this related unanswered question
请帮助!
[6]:
which foreman
/usr/bin/foreman
ls -lah /usr/bin/foreman # checked the updated date
推荐答案
在此处跟踪并解决:
https://github.com/ddollar/foreman/issues/244
TL ; DR:安装gem,不要使用foreman.pkg
TL;DR: Install the gem, don't use foreman.pkg
这篇关于使用领班启动时,Rails服务器挂起的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文