From: Hunter Walker Date: 2006-06-17T06:15:29+09:00 Subject: Re: require and Cron Daniel Harple wrote: > On Jun 16, 2006, at 8:51 PM, Hunter Walker wrote: > >> require 'QuickBaseClient' #this points to the QuickBaseClient.rb >> in the >> same directory as the file I am running. >> >> When I run this script from the command line: ruby init.rb it works >> great. >> >> When Cron tries to run it, it balks at the fact that it can't find >> QuickBaseClient > > > The file can not be found in any directory in $LOAD_PATH when cron > runs the ruby process. It works when you run init.rb from the same > directory because "." is in the $LOAD_PATH. Try: > > require File.dirname(__FILE__) + "/QuickBaseClient" # __FILE__ is the > current source file > > Another tip -- files are usually named like this: quick_base_client.rb > > -- Daniel Hi Daniel, Thank you for the response. I am a little confused. When you mean the source file, is that the QuickBaseClient.rb that is located in the same folder as my init.rb? Also, should the file name be in quotes? Thank you for your help! -- Posted via http://www.ruby-forum.com/.