From: Steven Davidovitz Date: 2006-06-17T04:03:18+09:00 Subject: Re: require and Cron On Sat, 17 Jun 2006 03:51:27 +0900 Hunter Walker wrote: > I have another ruby file that is required to run my app. > > 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 > > I imagine Cron is running this script in a temp dir, so I guess I need > to point at the original location of the QuickBaseClient.rb? If so, how > do I do that in code. I've always just used: require 'QuickBaseClient' > and Ruby has found the file and used its methods. > > Thanks for your help! > > -- > Posted via http://www.ruby-forum.com/. > > You can create a bash script and execute that. Something like: #!/bin/bash cd /home/dir/to/app ruby init.rb