本文介绍了Mongrel 与 WEBrick的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Mongrel 和 WEBrick 有什么区别?

What is the difference between Mongrel and WEBrick?

我应该使用哪个?

为什么 Rails 会同时提供两者?

Why does Rails ship with both?

推荐答案

对于您的本地开发,它们都可以工作.Mongrel 更快、更高效、更稳定.有些人(包括我自己)甚至使用它来托管他们的生产站点.对于本地开发当然没问题.

For your local development, they'll both work. Mongrel is faster, more efficient, and stable. Some people (myself included) use it to host their production sites, even. Certainly okay for local development.

如果您使用的是非 Windows,我建议您查看 Phusion Passenger.您可以在本地主机上支持多个应用程序,而无需每次运行时都执行ruby 脚本/服务器".

If you're on non-Windows, I'd suggest looking at Phusion Passenger. You can support multiple apps on your localhost without having to do a 'ruby script/server' every time you want to run something.

运行 Phusion Passenger 时,您必须自己跟踪日志文件.mongrel 将在控制台窗口中显示日志,因此要获得该功能,您必须tail -f log/development.log 与Passenger.

When running Phusion Passenger, you'll have to tail the log file yourself. mongrel will display the log in the console window, so to get that functionality you'll have to tail -f log/development.log with Passenger.

为什么 Rails 会同时提供两者?历史.Webrick 是用 ruby​​ 编写的,所以它是早期的最爱.Mongrel 出现并变得更好,但 webrick 支持并没有被放弃.

Why does Rails ship with both? History. Webrick is written in ruby, so it was the early favorite. Mongrel came along and was better, but webrick support wasn't dropped.

如果您不想安装 Phusion Passenger,请使用 mongrel.这是默认设置并且可以正常工作.

If you don't want to install Phusion Passenger, use mongrel. It's the default and it works.

EDIT 2009-08:我也很幸运地使用了 thin,这是一个不错的选择替代杂种.对于开发来说,这不是什么大不了的事,但在生产中需要检查一下.

EDIT 2009-08: I've also had good luck with thin, a drop-in replacement for mongrel. For development, it's not that big of a deal, but it'd be something to check out for production.

这篇关于Mongrel 与 WEBrick的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-23 20:31