【问题标题】:What is the best way to start thin in a rails application?在 Rails 应用程序中开始精简的最佳方法是什么?
【发布时间】:2013-05-23 20:34:53
【问题描述】:

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

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

这两种方式在性能/兼容性上有什么区别,还是rails s实际上只调用thin start

【问题讨论】:

    标签: ruby-on-rails webserver thin


    【解决方案1】:

    似乎它们在功能上是等效的。但是,只有在使用 rails >= 3.2 的情况下,向您的 Gemfile 添加 Thin 才会自动开始。否则,您将不得不通过在命令行中传递 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
    

    如果 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
    

    它会打印出有关 rails 环境的更多信息。似乎坚持rails server 约定是明智之举。虽然我没有看到两种开始瘦身的方式有什么不同,但我还是会坚持传统的rails server

    【讨论】:

      猜你喜欢
      • 2011-06-05
      • 1970-01-01
      • 2017-07-24
      • 2011-12-10
      • 2011-07-03
      • 1970-01-01
      • 2017-11-24
      • 1970-01-01
      • 2011-07-07
      相关资源
      最近更新 更多