简体   繁体   English

如何在红宝石上启用生产模式?

[英]How to enable production mode in ruby on rails?

Hi I want to know what I need to do in order to enable the production mode in RoR. 嗨,我想知道我需要做什么才能在RoR中启用生产模式。

When I add the line RailsEnv production to my Apache, after restart it I get an error message "We're sorry, but something went wrong. apache ruby". 当我将RailsEnv生产线添加到我的Apache中时,重新启动它后,我收到一条错误消息“很抱歉,但是出了点问题。apacheruby”。

The logs are empty, I migrated the db in production mode, compiled the assets, set RAILS_ENV to install all, but I can not run in production, in development works fine. 日志为空,我在生产模式下迁移了db,编译了资产,设置了RAILS_ENV以安装全部,但是我不能在生产中运行,在开发中工作正常。

I use Apache2 + Passenger. 我使用Apache2 + Passenger。 Would you help me? 你能帮我吗?

Thank you in advance! 先感谢您!

Assuming you have your production database information correctly defined in config/database.yml 假设您已在config / database.yml中正确定义了生产数据库信息

You can start Rails in Production mode by launching your application like this: 您可以通过以下方式启动应用程序以生产模式启动Rails:

$ rails s -e production -p 80 --bind=0.0.0.0

More information about Rails environment settings can be found here: http://guides.rubyonrails.org/configuring.html 有关Rails环境设置的更多信息,请参见: http : //guides.rubyonrails.org/configuring.html

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

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