1

我正在使用 Thin 将 Rails 应用程序部署到生产环境中。在启动 rails 后,Thin 关闭,唯一的输出是“Exiting”:

$ bundle exec rails s -e production
=> Booting Thin
=> Rails 4.0.0 application starting in production on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
>> Thin web server (v1.5.1 codename Straight Razor)
>> Maximum connections set to 1024
>> Listening on 0.0.0.0:3000, CTRL+C to stop 
Exiting

相同的配置/设置在开发中起作用。相同的配置适用于使用 WEBrick 的生产:

$ bundle exec rails s -e production
=> Booting WEBrick
=> Rails 4.0.0 application starting in production on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
[2013-07-19 17:59:07] INFO  WEBrick 1.3.1
[2013-07-19 17:59:07] INFO  ruby 2.0.0 (2013-06-27) [x86_64-linux]
[2013-07-19 17:59:07] INFO  WEBrick::HTTPServer#start: pid=5231 port=3000

当然,应该有可能从额定用于生产的 Web 服务器上收到一些关于它为什么关闭的输出。但是,我还没有发现如何。

有任何想法吗?

4

1 回答 1

2

事实证明,在生产模式下启动 Thin 使得 Rails 也使用 EventMachine 急切地加载模块,从而防止 Thin 代码在启动后被阻塞并立即关闭。

于 2013-07-20T22:51:49.500 回答