简体   繁体   English

Ruby on Rails 3的推荐开发Web服务器

[英]Recommended development web server for Ruby on Rails 3

What web server would you recommend for Ruby on Rails 3 web development on Linux? 你会推荐什么样的Web服务器用于Linux Ruby on Rails 3 Web开发? How about Windows? Windows怎么样?

I'd recommend the Thin server. 我推荐服务器。 Works great both on Linux and Windows. 适用于Linux和Windows。 And it's very easy to install: gem install thin . 而且它很容易安装: gem install thin If you are using Rails 3, you may want to add it do your Gemfile instead: 如果你使用Rails 3,你可能想要添加它做你的Gemfile:

group :development do
  gem "thin"
end

And then run bundle install . 然后运行bundle install

Once it's installed, you can run it with: rails s thin . 安装完成后,您可以使用: rails s thin来运行它。

I find it a very fast and clean choice. 我觉得这是一个非常快速和干净的选择。

Just a note: thin depends on the eventmachine gem. 只是注意:瘦身取决于eventmachine gem。 I had a hard time making it work on Windows. 我很难在Windows上运行它。 You might want to link it to this specific ref in github to avoid trouble: 您可能希望将其链接到github中的此特定引用以避免麻烦:

gem "eventmachine", :git => "http://github.com/eventmachine/eventmachine.git", :ref => "6c7997798"

As far as I remember, the last version of eventmachine does not build on Windows. 据我记忆,最后一个版本的eventmachine并不构建在Windows上。

In Rails 3, you can use Unicorn with ease! 在Rails 3中,您可以轻松使用Unicorn

group :development do
  gem "unicorn"
end

Instead of rails s you start your server by simply running 您只需运行即可启动服务器,而不是使用rails s

unicorn

For more verbose output, use 有关更详细的输出,请使用

unicorn -d

Passenger 3 Standalone. 乘客3独立。 As easy as passenger start . passenger start一样容易passenger start

On Windows the best is a VirtualBox instance running the same setup. 在Windows上,最好的是运行相同设置的VirtualBox实例。

您也可以考虑使用Unicorn作为rails 3的Web服务器。对于Windows,您可以使用apache或nginx运行mongrel集群。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM