Ruby on Rails Saturday, September 4, 2010

My first suspicion would be that you need the full path to rake....
but no promises :)

On Sep 4, 5:36 am, Frederick Cheung <frederick.che...@gmail.com>
wrote:
> On Sep 4, 5:38 am, boblu <bobl...@gmail.com> wrote:> I want to use rake background task in rails like this
>
> > system("cd #{Rails.root} && RAILS_ENV=#{Rails.env} rake abc:def --
> > trace 2>&1 >> #{Rails.root}/log/rake.log &")
>
> > This is ok in development environment, but will not work in production
> > mode.
>
> What happens?
>
> Fred
>
> > I used logger to check whether the command string is generated ok or
> > not, but it seems every things is fine in production evironment:
>
> > cd /home/username/rails_staging/Abc/releases/20100904034630 &&
> > RAILS_ENV=production rake abc:def --trace 2>&1 >> /home/username/
> > rails_staging/Abc/releases/20100904034630/log/rake.log &
>
> > Any body has any ideas about why this can not work in production mode?
>
> > Thanks

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment