Russell Fulton wrote:
> Well this is weird!  I'm used to odd problems when you run programs from 
> cron but these are almost invariably to do with file permissions or 
> stuff in the environment variables not matching the command line 
> environment.
> 
> I'm using ruby  1.8.4 (2005-12-24) [i686-linux] on a RHE 3.0 system.
> 
> The program runs fine from command line but gets nonsensical syntax 
> errors when run from cron.
> 
> Any idea where to look for the problem?

What is the user that actually runs the job in cron?

Are you using absolute paths?

#!/usr/local/bin/ruby

not

#!/usr/bin/env ruby

in the script (since env will differ for different users)?

When run from the CLI are there RUBYOPT values (e.g., rubygems) in the 
environment that are not there for cron?


-- 
James Britt

http://www.ruby-doc.org       - Ruby Help & Documentation
http://www.artima.com/rubycs/ - The Journal By & For Rubyists
http://www.rubystuff.com      - The Ruby Store for Ruby Stuff
http://refreshingcities.org   - Design, technology, usability