我正在尝试运行以下命令来在生产环境中运行服务器:
rackup private_pub.ru -s thin -E production
private_pub.ru 看起来像这样:
# Run with: rackup private_pub.ru -s thin -E production
require "bundler/setup"
require "yaml"
require "faye"
require "private_pub"
Faye::WebSocket.load_adapter('thin')
PrivatePub.load_config(File.expand_path("../config/private_pub.yml", __FILE__), ENV["RAILS_ENV"] || "production")
run PrivatePub.faye_app
我想将配置文件(thin.yml)传递给 Thin,如下所示:
#thin configuration for clazzoo_chat production deployment
user: deploy
group: deploy
所以这是我要执行的命令:
bundle exec rackup $APP_ROOT/private_pub.ru -s thin -C $APP_ROOT/config/thin.yml start -E production
但是 rackup 不支持 -C 因为这个参数是针对瘦的......根据这些文档:https ://github.com/macournoyer/thin/#configuration-files
我还尝试将我的命令更改为:
bundle exec thin -C config/thin.yml -R private_pub.ru start
但后来我得到错误:
Exiting!
/home/deploy/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/thin-1.6.3/lib/rack/adapter/loader.rb:32:in `read': No such file or directory @ rb_sysopen - private_pub.ru (Errno::ENOENT)
from /home/deploy/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/thin-1.6.3/lib/rack/adapter/loader.rb:32:in `load'
from /home/deploy/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/thin-1.6.3/lib/thin/controllers/controller.rb:182:in `load_rackup_config'
from /home/deploy/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/thin-1.6.3/lib/thin/controllers/controller.rb:72:in `start'
from /home/deploy/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/thin-1.6.3/lib/thin/runner.rb:200:in `run_command'
from /home/deploy/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/thin-1.6.3/lib/thin/runner.rb:156:in `run!'
from /home/deploy/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/thin-1.6.3/bin/thin:6:in `<top (required)>'
from /home/deploy/.rbenv/versions/2.2.2/bin/thin:23:in `load'
from /home/deploy/.rbenv/versions/2.2.2/bin/thin:23:in `<main>'
Writing PID to current/tmp/pids/thin.0.pid
在我的设置中 - 当机架运行很薄时,如何将此配置(thin.yml)传递给瘦?