问题:
问题类似于生产中的 Faye 设置。无法在CloudControl上启动 Faye 。这里是faye.ru
:
require 'faye'
faye_server = Faye::RackAdapter.new(:mount => '/faye', :timeout => 45)
Faye::WebSocket.load_adapter('thin')
run faye_server
这里是Procfile
:
web: bundle exec thin start -R config.ru -e $RAILS_ENV -p $PORT
faye: bundle exec thin start -R faye.ru -p 9292
暂存日志:
11/21/14 12:27 PM Deploy ***** Deployed 09c2174cba4b14375779a5160ab7348a62a570b4 *****
11/21/14 12:27 PM Info Started GET "/" for 10.99.3.169 at 2014-11-21 10:27:02 +0000
11/21/14 12:27 PM Info Listening on 0.0.0.0:25143, CTRL+C to stop
11/21/14 12:27 PM Info Maximum connections set to 1024
11/21/14 12:27 PM Info Thin web server (v1.6.3 codename Protein Powder)
11/21/14 12:27 PM Deploy ***** Deployed 09c2174cba4b14375779a5160ab7348a62a570b4 *****
11/21/14 12:27 PM Info Started GET "/" for 10.94.134.23 at 2014-11-21 10:27:01 +0000
11/21/14 12:27 PM Info Listening on 0.0.0.0:12103, CTRL+C to stop
11/21/14 12:27 PM Info Maximum connections set to 1024
11/21/14 12:27 PM Info Thin web server (v1.6.3 codename Protein Powder)
而且myapp.cloudcontrolapp.com 还可以,但是我无法获取myapp.cloudcontrolapp.com:9292/faye.js
如果我用 faye 在本地启动 rails server,我就可以了: 1. rails s 2. if Rails.env.development?
Thread.new do
system("rackup faye.ru -s thin -E production")
end
end
in initializer。本地日志是:
Thin web server
Maximum connections set to 1024
Listening on 0.0.0.0:9292, CTRL+C to stop
Thin web server
Maximum connections set to 1024
Listening on 0.0.0.0:3000, CTRL+C to stop
并且 localhost:9292/faye.js 没问题, localhost:3000 没问题
有人可以指出我如何在 cloudControl 上开始 faye 吗?谢谢你。