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
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 > _______________________________________________ > Backgroundrb-devel mailing list > Backgroundrb-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/backgroundrb-devel >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20060906/f19603a9/attachment.html
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 _______________________________________________ Backgroundrb-devel mailing list Backgroundrb-devel at rubyforge.org http://rubyforge.org/mailman/listinfo/backgroundrb-devel
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
Thanks guys. That worked. Not sure why it wasn''t picking it up correctly. Anyways, thanks again. Chris -----Original Message----- From: backgroundrb-devel-bounces at rubyforge.org [mailto:backgroundrb-devel-bounces at rubyforge.org] On Behalf Of Eden Li Sent: Thursday, September 07, 2006 9:05 AM To: backgroundrb-devel at rubyforge.org Subject: Re: [Backgroundrb-devel] Setting Product Env 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 gettingdevelopment. 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 yourserver, 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 Ido.> I set background.yml to production.??I even have ENV[''RAILS_ENV''] ||> ''production uncommented in environment.rb.??I don''t have thedevelopment> db even created on my production box, so not sure where it is getting > development from.??I am using fastcgi and have the environmentcorrectly> specified in my fastcgi config. > > Any ideas? > > > > Thanks, > > > Chris_______________________________________________ Backgroundrb-devel mailing list Backgroundrb-devel at rubyforge.org http://rubyforge.org/mailman/listinfo/backgroundrb-devel