工头只显示“开始机智pid#”而没有别的 [英] foreman only shows line with “started wit pid #” and nothing else
问题描述
>当运行领班时,我会得到以下结果:工头开始
16:47:56 web.1 |以pid开头27122
只有当我停止它时(通过ctrl-c)它才会显示我缺少的东西:
^ CSIGINT收到
16:49:26 system |发送SIGTERM到所有进程
16:49:26 web.1 | =>启动Thin
16:49:26 web.1 | => Rails 3.0.0应用程序在http://0.0.0.0:5000
16:49:26 web.1 | =>用-d呼叫以分离
16:49:26 web.1 | => Ctrl-C关闭服务器
16:49:26 web.1 | >>瘦网络服务器(v1.3.1 codename Triple Espresso)
16:49:26 web.1 | >>最大连接数设置为1024
16:49:26 web.1 | >>听取0.0.0.0:5000,CTRL + C停止
16:49:26 web.1 | >>停止...
16:49:26 web.1 |退出
16:49:26 web.1 | >>停止...
我该如何解决它?
- 解决方案
从 https://github.com/ddollar/foreman/wiki/Missing-Output : b
$ b
如果您没有看到程序的任何输出,则可能有
的机会缓冲标准输出。 Ruby默认缓冲stdout。要
禁用此行为,请尽早在
程序中添加此代码:
#ruby
$ stdout.sync = true
通过 heroku toolbelt软件包安装工头
但我仍然不知道发生了什么,也不知道为什么以上两种方式解决了这个问题......
When I run foreman I get the following:
> foreman start
16:47:56 web.1 | started with pid 27122
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 ...
How do I fix it?
I’ve been able to resolve this issue by 2 different ways:
From https://github.com/ddollar/foreman/wiki/Missing-Output:
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
By installing foreman via the heroku toolbelt package
But I still don’t know what’s happening nor why this 2 ways above resolved the issue…
这篇关于工头只显示“开始机智pid#”而没有别的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!