Customized cron path
Posted by: bjhess
Posted on: 2008-07-25 17:02:00
I have a custom gem source installed in ~/.gems. My ~/.bashrc looks like:
export GEM_HOME="$HOME/.gems"
export GEM_PATH="$GEM_HOME:/usr/lib/ruby/gems/1.8"
export PATH="$HOME/.gems/bin:$PATH"
My ~/.gemrc looks like:
gemhome: /home/bjhess/.gems
gempath:
- /home/bjhess/.gems
- /usr/lib/ruby/gems/1.8
So. I can run ruby jobs with special "requires" from my local gems fine via the command-line. However, when shoving the command into a recurring cron task, I get "no such file to load" errors:
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require': no such file to load -- flickr_fu (LoadError)
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require'
from /home/.../.../scripts/slurp_flickr.rb:2
And if I try to call a command directly provided by a local gem (say, "staticmatic"), I get:
/bin/sh: line 1: staticmatic: command not found
What paths do I need to update to make these custom gems available from cron? I've scoured the 'net and the cron wiki for answers, but I can't fine 'em!
TIA,
Barry