I'm relatively new to Ruby on Rails and occasionally I find this convention-over-configuration stuff a little confusing as a lot of things seemed to be hidden from the developer, as in this case.
I'm using rails 2.3.8 and when I run my app locally through NetBeans 6.9/Mongrel on my system it runs using the development environment parameters.. when I deploy it to a Fedora box and run it there in Apache HTTPD it automatically runs using the production environment parameters.
How does my app know which environment to use? I haven't changed anything in my app to set the environment.. both versions locally and on my Fedora box are identical. I can't find anywhere in the code where it is setting the environment.. so how is this working?
Thanks.
The primary way to specify rails mode is
RAILS_ENV
environment variable (I assumedevelopment
is default, when nothing is specified). You can check its value in bash,echo $RAILS_ENV
.You can also modify
ENV['RAILS_ENV']
in your config file to change the mode:edit
I've never used rails with apache, but I think passenger mod can also specify this variable somewhere, checking apache configs might help.
In httpd.conf file, write the following in VirtualHost:-
Thanks...