My first suspicion would be that you need the full path to rake.... but no promises :)
On Sep 4, 5:36 am, Frederick Cheung <[email protected]> wrote: > On Sep 4, 5:38 am, boblu <[email protected]> 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

