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

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4535220/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-05 02:18:04  来源:igfitidea点击:

Recommended development web server for Ruby on Rails 3

ruby-on-railswindowslinuxruby-on-rails-3

提问by Alpha Sisyphus

What web server would you recommend for Ruby on Rails3 web development on Linux? How about Windows?

您会推荐哪种 Web 服务器用于LinuxRuby on Rails3 Web 开发?窗户呢?

采纳答案by Wagner Maestrelli

I'd recommend the Thinserver. Works great both on Linux and Windows. And it's very easy to install: gem install thin. If you are using Rails 3, you may want to add it do your Gemfile instead:

我会推荐服务器。在 Linux 和 Windows 上都能很好地工作。而且安装非常简单:gem install thin. 如果您使用的是 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. I had a hard time making it work on Windows. You might want to link it to this specific ref in github to avoid trouble:

请注意:瘦取决于 eventmachine gem。我很难让它在 Windows 上运行。您可能希望将其链接到 github 中的此特定 ref 以避免出现问题:

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.

据我所知,事件机器的最后一个版本不是在 Windows 上构建的。

回答by glebm

Passenger 3 Standalone. As easy as passenger start.

乘客 3 独立。一样简单passenger start

On Windows the best is a VirtualBox instance running the same setup.

在 Windows 上,最好的是运行相同设置的 VirtualBox 实例。

回答by armnov

you might also consider using Unicornas your web server for rails 3. For Windows, you can run mongrel cluster with apache or nginx.

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

回答by ma?ek

In Rails 3, you can use Unicornwith ease!

在 Rails 3 中,您可以轻松使用Unicorn

group :development do
  gem "unicorn"
end

Instead of rails syou start your server by simply running

而不是rails s通过简单地运行来启动服务器

unicorn

For more verbose output, use

要获得更详细的输出,请使用

unicorn -d