Hi,
Some hosts (e.g. Site5, which I've been using) don't respect the
rails_env setting in capistrano.
I'm not sure on the details of servers respecting that variable, but
I'm currently using:
run "sed -i -e '/ENV.*RAILS_ENV/s/# //' #{release_path}/config/
environment.rb"
run "sed -i -e '/ENV.*RAILS_ENV/s/production/#{rails_env}/'
#{release_path}/config/environment.rb"
in the after_update_code task to manually set this in the
environment.rb file.
The first line uncomments the ENV['RAILS_ENV'] ||= 'production' line,
and the second replaces production with whatever the rails_env
variable is set to (this isn't really necessary for your use, but it's
helpful if you get into multistage releases, and want to set the
environment to something other than 'production').
- Chris
Steve Flinter wrote:
> Hi,
>
> as a relative newcomer to capistrano, this might be an obvious
> question.
>
> In my environment.rb the following is commented out, as normal:
>
> # ENV['RAILS_ENV'] ||= 'production'
>
> When the environment.rb is copied over to my production environment,
> this doesn't change, and hence the production env is still running in
> development mode.
>
> So my question is, what is the most appropriate way to switch the
> configuration from development to production after a cap deploy?
>
> After some googling, one option I came across was to put the following
> line in the deploy.rb:
>
> set :rails_env, :production
>
> However, this had no noticeable effect.
>
> Thanks,
>
> Steve
--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---