[英]What is the best way to start thin in a rails application?
You can start the thin server by one of the following ways: 您可以通过以下方式之一启动瘦服务器:
thin start
rails s
(if you have thin in the Gemfile
) rails s
(如果您在Gemfile
) Is there any difference on performance/compatibility between these two ways, or the rails s
actually only calls thin start
? 这两种方式在性能/兼容性上是否有任何区别,或者
rails s
实际上仅称为thin start
?
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. 但是,只有在使用rails> = 3.2的情况下,将精简文件添加到
Gemfile
才会自动启动精简文件。 Otherwise, you will have to start thin by passing rails server thin
at the command line. 否则,您将必须通过在命令行中将
rails server thin
传递来开始瘦身。
$ 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> = 3.2或
rails server thin
请注意thin start
和rails server
之间的区别
$ 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. 它打印出有关rails环境的更多信息。 It seems that sticking to the
rails server
convention would be the wise thing to do. 似乎坚持使用
rails server
约定是明智的选择。 Although I haven't seen anything different between the two ways of starting thin, I would stick with the conventional rails server
尽管我没有发现两种开始瘦的方式之间有什么不同,但我还是会坚持使用传统的
rails server
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.