[Backgroundrb-devel] Setting Product Env

Eden Li eden.li at gmail.com
Thu Sep 7 12:05:18 EDT 2006


I ran into this problem when my config/database.yml defined no
development database.  I fixed it by prepending the start command with
RAILS_ENV=production ala

RAILS_ENV=production script/backgroundrb/start -d

I don't know if this will fix your problem since you mention that
you're setting RAILS_ENV already in config/environment.rb, but this
worked for me.

From: "Chris Bruce" <cbruce at sleeter.com>
> Subject: Re: [Backgroundrb-devel] Setting Product Env
> To: <Backgroundrb-devel at rubyforge.org>
> Message-ID:
>         <204BD979E361E64DAF7FAC6996884BA629FD60 at tsg-srv-03.sleeter.com>
> Content-Type: text/plain;       charset="iso-8859-1"
>
> I double and triple checked that.  Not sure how it is getting development.  Do you know of any way to force it?
>
>
>
> Chris
>
>
> ________________________________________
> From: backgroundrb-devel-bounces at rubyforge.org [mailto:backgroundrb-devel-bounces at rubyforge.org] On Behalf Of Jonathan M?tillon
> Sent: Wednesday, September 06, 2006 1:08 AM
> To: Backgroundrb-devel at rubyforge.org
> Subject: Re: [Backgroundrb-devel] Setting Product Env
>
> Chris,
>
> Maybe you are using version control and when you deploy to your server, you don't update your newly checked out version so it uses production. That's what happened to me. For example in my deploy recipe I have:
>
> run "cat #{release_path}/config/backgroundrb.yml | sed 's#development#production#g' > #{release_path}/config/backgroundrb.yml"
>
> Just before the BackgrounDRb restart:
>
> sudo "#{release_path}/script/backgroundrb/restart"
> On 9/6/06, Chris Bruce <cbruce at sleeter.com> wrote:
>
> When I am using my rails models in my worker class, it appears the
> background worker class is always using development no matter what I do.
> I set background.yml to production.??I even have ENV['RAILS_ENV'] ||=
> 'production uncommented in environment.rb.??I don't have the development
> db even created on my production box, so not sure where it is getting
> development from.??I am using fastcgi and have the environment correctly
> specified in my fastcgi config.
>
> Any ideas?
>
>
>
> Thanks,
>
>
> Chris


More information about the Backgroundrb-devel mailing list