From: James Britt Date: 2005-03-19T02:34:37+09:00 Subject: Re: Crobjob problem with ruby script. Robert Klemme wrote: > schrieb im Newsbeitrag > news:1111161279.684304.8420@f14g2000cwb.googlegroups.com... > >>James Britt wrote: >> >>>What shebang line are you using? >> >>None... do I need to add one to my ruby scripts? >> >> >>>What user account is executing the code? >> >>root is executing the scripts >> >>-andreas > > > You probably should set $LOAD_PATH explicitely in the script. Try > ruby -e 'p $LOAD_PATH' > and see what it prints from the command line and from cron. I've has issues with cron jobs because of assorted mismatched user/path/env details. For example, I tried code that began with #!/usr/bin/env ruby and this failed because that relies on a given environment setting. So, perhaps set a shebang line that points right to ruby. Also, make sure that the $LOAD_PATH is not relying on any special environment settings (though I've net seen this as an issue myself). I believe I've had issues with cron job code making false assumptions about the current directory and relative paths. Robert's suggestion is a really good one. Ive also done that with a script to loop over ENV just to see what the whole environment was. And are you *sure* these need to run as root? One side-effect I have seen as a result of root cron jobs is that I get files I cannot edit or delete without becoming root myself. James Britt