我正在我们的登台服务器上执行此操作以启动Sinatra应用程序:
envdir /etc/sv-env env RUBYLIB=./lib TZ=UTC VERBOSE=yes bundle exec thin --address 0.0.0.0 --port 9293 --environment development --rackup frontend.ru start
它似乎开始很薄,但只要我GET
地址,就会显示以下错误(在控制台上):
Unexpected error while processing request: env missing required key SERVER_PORT
/var/lib/gems/1.9.1/gems/rack-1.5.2/lib/rack/lint.rb:20:in `assert'
/var/lib/gems/1.9.1/gems/rack-1.5.2/lib/rack/lint.rb:201:in `block in check_env'
/var/lib/gems/1.9.1/gems/rack-1.5.2/lib/rack/lint.rb:197:in `each'
/var/lib/gems/1.9.1/gems/rack-1.5.2/lib/rack/lint.rb:197:in `check_env'
/var/lib/gems/1.9.1/gems/rack-1.5.2/lib/rack/lint.rb:43:in `_call'
/var/lib/gems/1.9.1/gems/rack-1.5.2/lib/rack/lint.rb:37:in `call'
/var/lib/gems/1.9.1/gems/thin-1.6.2/lib/thin/connection.rb:86:in `block in pre_process'
/var/lib/gems/1.9.1/gems/thin-1.6.2/lib/thin/connection.rb:84:in `catch'
/var/lib/gems/1.9.1/gems/thin-1.6.2/lib/thin/connection.rb:84:in `pre_process'
/var/lib/gems/1.9.1/gems/thin-1.6.2/lib/thin/connection.rb:53:in `process'
/var/lib/gems/1.9.1/gems/thin-1.6.2/lib/thin/connection.rb:39:in `receive_data'
/var/lib/gems/1.9.1/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run_machine'
/var/lib/gems/1.9.1/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run'
/var/lib/gems/1.9.1/gems/thin-1.6.2/lib/thin/backends/base.rb:73:in `start'
/var/lib/gems/1.9.1/gems/thin-1.6.2/lib/thin/server.rb:162:in `start'
/var/lib/gems/1.9.1/gems/thin-1.6.2/lib/thin/controllers/controller.rb:87:in `start'
/var/lib/gems/1.9.1/gems/thin-1.6.2/lib/thin/runner.rb:199:in `run_command'
/var/lib/gems/1.9.1/gems/thin-1.6.2/lib/thin/runner.rb:155:in `run!'
/var/lib/gems/1.9.1/gems/thin-1.6.2/bin/thin:6:in `<top (required)>'
/usr/local/bin/thin:19:in `load'
/usr/local/bin/thin:19:in `<main>'
我正在使用瘦1.6.2。
相同的命令在我的开发机器上运行(dev和staging都运行Ubuntu服务器12.04 LTS)。 但与dev的一个区别是,分段是通过HAProxy代理的。
有什么想法吗?