From: Matthew Lagace Date: 2009-06-06T00:00:51+09:00 Subject: Re: Problem with cronjob and ruby script Hmm I've tried running with a blank environment and it fails with the same error not finding the gems. I have set the ENV variables to the proper directories and it is still giving me the same error. I'm not sure what else to try although I appreciate all your recommendations! Bil Kleb wrote: > Matthew Lagace wrote: >> Hello, > > Hi. > >> I'm trying to get a ruby script run into a crontab and it keeps failing >> saying it can't find my mechanize gem. When I run the script form the >> command line, everything runs fine and I don't get any failures. >> >> Anyone ever had that problem before? > > Oh yes. > > Try getting it to run from the command line with a blank > environment with 'env -', e.g., > > % env - run_stuff.sh > > Typically a crontab job runs with a much reduced environment. > > Alternatively, stick a printenv in your crontab to see > what environment it is working with and compare to your > interactive environment. > > You might also find crontab's sister command, 'at', helpful > to get tighter feedback cycles. > > Regards, -- Posted via http://www.ruby-forum.com/.