简体   繁体   English

在Rails应用程序中开始精简的最佳方法是什么?

[英]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 startrails 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.

相关问题 打包Ruby on Rails应用程序的最佳方法是什么? - What is the best way to package a Ruby on Rails Application? 为 Rails 应用程序轮换日志的最佳方法是什么 - What is the best way to rotate logs for rails application 启动Ruby Rails网站的单元和功能测试的最佳方法是什么? - What is the best way to start Unit and Functional testing of a Ruby Rails website? 在Rails应用程序中存储全局应用程序设置的最佳方法是什么? - What's the best way to store global application settings in a Rails application? 如何检测Rails应用程序使用的服务器(瘦,美洲狮,乘客......)? - How to detect what server (thin, puma, passenger, …) is used for Rails application? 在Rails 5中测试应用程序控制器紧急状态代码的最佳方法是什么? - What is the best way to test application controller rescue status codes in Rails 5? 将文件上传到另一个Rails应用程序的最佳方法是什么? - What is the best way to upload a file to another Rails application? 将JRuby on Rails应用程序部署到Tomcat的最佳方法是什么? - What's the best way to deploy a JRuby on Rails application to Tomcat? 在Rails应用程序中运行异步作业的最佳方法是什么? - What is the best way to run asynchronous jobs in a Rails application? 编写复杂的Rails应用程序的最佳方法是什么? - What's the best way to write a complex Rails application?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM