Thanks, Adam. RailsPlayground tells me that the
ENV['RAILS_ENV'] ||= 'production' line is only needed with FCGI, which I just switched away from to Passenger, so it's no longer needed. I am just using mongrel in development, nothing fancy in my apps with regard to the web server, so simpler is better. Of course, I still feel like I barely understand all the nuances of all these alternatives. Scott At 09:31 AM 12/1/2009, you wrote: >Hi Scott, > >Since you are using RailsPlayground, I assume you are on Phusion >Passenger? If so, Passenger has a specific option to set the >environment when booting up the Rails app: > ><http://www.modrails.com/documentation/Users%20guide.html#rails_env>http://www.modrails.com/documentation/Users%20guide.html#rails_env >============================= > > >RailsEnv <string> > > > >This option allows one to specify the default RAILS_ENV value. > >This option may occur in the following places: > * In the global server configuration. > * In a virtual host configuration block. > * In a <Directory> or <Location> block. > * In .htaccess, if AllowOverride Options is on. > >In each place, it may be specified at most once. The default value >is production. > >============================= > >It sounds like you are probably using passenger in dev as well (in >mongrel it defaults to dev), so this would work on your local dev box as well. >I, just yesterday in fact, setup my deployment script (using Vlad) >to generate a "RAILS_ROOT/config/app_constants.rb" file from a >template that gets loaded first thing by environment.rb, so on each >deploy I can tell my Vlad script which variable values I want >(MAIL_DOMAIN, MY_APP_VERSION, RAILS_ENV) inserted into that template >to be deployed. That way, I can have a small set of config variables >in my vlad script for each environment (test box, staging, >production) and I can switch any of them to dev or production with a >quick deploy! > >-- >Adam Grant >Lead Web Engineer >Telaeris, Inc. ><mailto:[email protected]>[email protected] >(858) 627-9710 > > >On Wed, Nov 25, 2009 at 4:09 PM, Scott Olmsted ><<mailto:[email protected]>[email protected]> wrote: > >The app I'm adding to has this line uncommented in environment.rb: > > >ENV['RAILS_ENV'] ||= 'production' > >and the instructions at the hosting site >(<http://railsplayground.com>railsplayground.com) instruct one to do this. > >This means I either have to edit this file to work in development on >my machine, and remember to change it back before deploying, or work >in production mode, which is undesirable for a number of reasons. > >I've not seen this on the few other servers I've dealt with. What >are they doing differently that requires this? > >Thanks, > >Scott > >-- >SD Ruby mailing list ><mailto:[email protected]>[email protected] >http://groups.google.com/group/sdruby > > >-- >SD Ruby mailing list >[email protected] ><http://groups.google.com/group/sdruby>http://groups.google.com/group/sdruby -- SD Ruby mailing list [email protected] http://groups.google.com/group/sdruby
