cron job not working
Posted by: hydromint
Posted on: 2007-04-05 16:42:00
I have a ruby script that works just fine on Dreamhost's servers, but when it is run by cron, it fails with:
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require': no such file to load -- hpricot (LoadError)
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require'
from /home/hydromint/lfdb.hydromint.com/current/get_new_listings.rb:7
At the top of my script, I have:
#!/usr/bin/env ruby
# I need to add these to the require search path
$: << "./vendor/hpricot-0.5/lib"
$: << "./vendor/mechanize-0.6.5/lib"
require "rubygems"
require 'hpricot'
require "mechanize"
require "logger"
require "mysql"
Again, when I run the script with ./get_new_listings.rb ON THE SERVER, it completes successfully, but every cron report gives me the above error. Any ideas?