From: Bil Kleb Date: 2009-06-05T23:45:06+09:00 Subject: Re: Problem with cronjob and ruby script 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, -- http://twitter.com/bil_kleb