gkaykck
gkaykck

Reputation: 2367

Environments in Rails

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 environment from development to production, i want info about them.

Upvotes: 0

Views: 139

Answers (3)

Anubhaw
Anubhaw

Reputation: 6068

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>

Upvotes: 1

rubyprince
rubyprince

Reputation: 17793

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

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

Upvotes: 0

Reuben Mallaby
Reuben Mallaby

Reputation: 5767

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.

Upvotes: 0

Related Questions