0

您可以通过以下方式之一启动瘦服务器:

  • thin start
  • rails s(如果你有瘦的Gemfile

这两种方式或rails s实际上唯一的调用之间的性能/兼容性有什么区别thin start

4

1 回答 1

4

It seems that they are both functionally equivalent. However, adding thin to your Gemfile will only start thin automatically if you are using rails >= 3.2. Otherwise, you will have to start thin by passing rails server thin at the command line.

$ thin start
>> Using rack adapter
>> 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

Notice the difference between thin start and rails server if rails >= 3.2 or rails server thin

$ rails server thin
=> Booting Thin
=> Rails 3.2.13 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> 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

It prints out more info about the rails environment. It seems that sticking to the rails server convention would be the wise thing to do. Although I haven't seen anything different between the two ways of starting thin, I would stick with the conventional rails server

于 2013-05-23T22:52:19.523 回答