Beautiful. This was my exact problem, and exact solution.
For those that are not Linux heads through and through (anyone besides
me? :)) you can find your user's shell and path with:
echo $PATH
and
echo $SHELL
On Jul 26, 11:23 pm, PJAY79 <
pjay1...@hotmail.com> wrote:
> Thank you Joe, i added the PATH to the script and it seems to be
> working.
>
> PJ.
>
> On Jul 27, 12:51 pm, "Joe Noon" <
joen...@gmail.com> wrote:
>
> > I just ran into this myself. Its most likely that yourcronenvironment
> > isn't the same as your app's user's environment. To fix that, get the PATH
> > of your app's user and set it in the crontab file. Also, set the shell to
> > the same as what you get when you ssh in (mine is bash). Here's an excerpt
> > of mine to show what I mean:
>
> > PATH=/usr/local/bin:/usr/bin:/bin
> > SHELL=/bin/bash
>
> > # re-index sphinx every 20 minutes
> > 12,32,52 * * * * cd /var/www/app/current && RAILS_ENV=production rake
> > thinking_sphinx:index >> /dev/null 2>&1
>
> > Unrelated, but you can set MAILTO the same way.
>
> > Joe
>
> > > I am trying to rebuild the index usingcronand am having trouble with
> > > this. I am using an Ubuntu Gutsy server, with Rails 2.0.2.
>
> > > I have created a script that would be run undercronevery day. This