Hi,
I am using ruby 1.9.2 and rails 3 for my application.
I have written a bash script which I want to run in cron.
If I directly run the bash file it runs. If I run it through the cron I
get the following error:-
"/usr/local/rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in
`require': no such file to load -- rails/commands/runner (LoadError)
  from
/usr/local/rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in
`require'
  from runner:10:in `<main>'
  from
/usr/local/rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in
`require'
  from runner:10:in `<main>'"

My runner.rb is as follows:-
#!/usr/bin/env ruby

# script/runner for rails 3.0

APP_PATH  = File.expand_path('../../config/environment',  __FILE__)
require 'rubygems'
require 'rails/commands/runner'

My Bash file is as follows:-
MYPATH=/usr/local/rvm/rubies/ruby-1.9.2-p180/bin
$MYPATH/ruby runner test.rb -e test

Can anyone tell me what is the wrong with this?

Thanks,
Tushar

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to