Rails 2.3.3-设置为生产模式
问题描述:
如何将应用程序设置为生产模式?
好的,这肯定是一件容易的事,但是我要部署我的第一个Rails应用程序,并且我已经正确设置了所有东西:Ubuntu Hardy,Passenger,MySQL.但是,它仍在开发模式下运行.我只能找到旧版Rails的文档,并希望确保自己做的正确.
Okay, this must be a no-brainer but I'm about to deploy my first Rails app and I've got everything setup properly: Ubuntu Hardy, Passenger, MySQL. However, it's still running in development mode. I've only been able to find documentation for older versions of Rails and want to make sure that I'm doing it right.
谢谢.
答
您需要设置RackEnv而不是RailsEnv.其实,我只是两者都做(尽管我可能不需要...?).
You'll need to set the RackEnv instead of RailsEnv. Actually, I just do both (although I mightn't need to...?).
Rails 2.3应用程序的示例虚拟主机:
Example vhost for a Rails 2.3 app:
<VirtualHost *:80>
...
RackEnv production
RailsEnv production
...
</VirtualHost>