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
=============================
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.
[email protected]
(858) 627-9710


On Wed, Nov 25, 2009 at 4:09 PM, Scott Olmsted <[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 (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
> [email protected]
> http://groups.google.com/group/sdruby
>

-- 
SD Ruby mailing list
[email protected]
http://groups.google.com/group/sdruby

Reply via email to