工头只显示“以 pid # 开头"的行,没有别的 [英] foreman only shows line with “started with pid #” and nothing else
本文介绍了工头只显示“以 pid # 开头"的行,没有别的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我运行工头时,我得到以下信息:
When I run foreman I get the following:
> foreman start
16:47:56 web.1 | started with pid 27122
只有当我停止它(通过 ctrl-c)时,它才会向我显示缺少的内容:
Only if I stop it (via ctrl-c) it shows me what is missing:
^CSIGINT received
16:49:26 system | sending SIGTERM to all processes
16:49:26 web.1 | => Booting Thin
16:49:26 web.1 | => Rails 3.0.0 application starting in development on http://0.0.0.0:5000
16:49:26 web.1 | => Call with -d to detach
16:49:26 web.1 | => Ctrl-C to shutdown server
16:49:26 web.1 | >> Thin web server (v1.3.1 codename Triple Espresso)
16:49:26 web.1 | >> Maximum connections set to 1024
16:49:26 web.1 | >> Listening on 0.0.0.0:5000, CTRL+C to stop
16:49:26 web.1 | >> Stopping ...
16:49:26 web.1 | Exiting
16:49:26 web.1 | >> Stopping ...
我该如何解决?
推荐答案
我已经能够通过两种不同的方式解决这个问题:
I’ve been able to resolve this issue by 2 different ways:
如果您没有看到程序的任何输出,则可能是它正在缓冲标准输出的机会.Ruby 默认缓冲标准输出.到禁用此行为,请尽早将此代码添加到您的程序:
If you are not seeing any output from your program, there is a likely chance that it is buffering stdout. Ruby buffers stdout by default. To disable this behavior, add this code as early as possible in your program:
# ruby
$stdout.sync = true
通过 heroku toolbelt 包安装 foreman
但我仍然不知道发生了什么,也不知道为什么上述两种方法解决了问题……
But I still don’t know what’s happening nor why this 2 ways above resolved the issue…
这篇关于工头只显示“以 pid # 开头"的行,没有别的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文