开发者

Environments in Rails

开发者 https://www.devze.com 2023-02-08 23:43 出处:网络
I have read that deploying an application on development environment may be one of the worst cases, but i couldn\'t find any real information about HOW i can change the environments of my applications

I have read that deploying an application on development environment may be one of the worst cases, but i couldn't find any real information about HOW i can change the environments of my applications and make their production databases ready?

I am using Passenger/Nginx for deployment by the way.

Edit : People you get it wrong, maybe i asked wrong, i know how to change environments by nginx, but if i change it from nginx and don't touch to my app, it crashes. There are some things i have to done to my app before i change their envi开发者_运维问答ronment from development to production, i want info about them.


In your virtual host put following environment variable:-

<VirtualHost *:80>
  DocumentRoot /var/apache2/htdocs/tutorial/Web/
  ServerName dev.tutorial.local
  SetEnv FLOW3_CONTEXT Production
</VirtualHost>


http://www.modrails.com/documentation/Users%20guide%20Nginx.html#RailsEnv

From the Passenger documentation, RAILS_ENV defaults to production.

If not you can specify it in the nginx configuration:

  • In the http configuration block.
  • In a server configuration block.
  • In a location configuration block.
  • In an if configuration scope.


I am not sure. but try changing environment varaible in config/environment.rb

ENV['RAILS_ENV'] ||= 'production'
0

精彩评论

暂无评论...
验证码 换一张
取 消