Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/67.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails Faye服务器不是由foreman启动的_Ruby On Rails_Faye_Foreman - Fatal编程技术网

Ruby on rails Faye服务器不是由foreman启动的

Ruby on rails Faye服务器不是由foreman启动的,ruby-on-rails,faye,foreman,Ruby On Rails,Faye,Foreman,我想让费伊和福尔曼开始。我的proc文件如下所示: web: bundle exec rails server thin -p $PORT -e $RACK_ENV worker: bundle exec sidekiq redis: bundle exec redis-server faye: bundle exec rackup faye.ru -s thin -E production 当我运行bundle exec foreman start web、worker和redis服务器都能

我想让费伊和福尔曼开始。我的proc文件如下所示:

web: bundle exec rails server thin -p $PORT -e $RACK_ENV
worker: bundle exec sidekiq
redis: bundle exec redis-server
faye: bundle exec rackup faye.ru -s thin -E production
当我运行
bundle exec foreman start

web、worker和redis服务器都能正确启动,但faye服务器不能

在控制台中我得到:
10:53:56 faye.1 |以pid 10907开始

然后费伊就再也没说什么了


如果我使用procfile:
bundle exec rackup faye.ru-s thin-E production
中的命令运行faye服务器,faye将正确启动。我做错了什么?

看起来费伊跑得不错。尝试访问
http://localhost:{PORT}/faye.js
查看是否有响应。它应该与JS一起返回。确保在调用faye服务器时使用正确的端口。一旦您开始提出请求,您应该会看到foreman吐出faye日志。

当您在本地运行此操作时:

bundle exec rackup faye.ru -s thin -E production
rackup
将使用其默认端口9292

在Herkou上运行时,如果该端口已在使用,则可能无法启动。据我所知,Heroku动态地将
$PORT
变量分配给有效的空闲端口

我猜Faye不是从另一个港口出发就是根本不出发。

这是Foreman的问题

如果您没有看到程序的任何输出,则很可能它正在缓冲
stdout
。默认情况下,许多语言,如Ruby和Python缓冲区
stdout

Faye没有设置
$stdout.sync=true
,因此其输出丢失


不久前我也遇到过同样的问题,并试图解决它,但我的解决方案被拒绝。

您好,您选择了什么解决方案?