On May 20, 10:12 am, Tushar Gandhi <li...@ruby-forum.com> wrote:
> 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

Cron starts up with a pretty stripped environment - it's probably not
seeing your rvm install.

Fred
> get the following error:-
> "/usr/local/rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/cu 
> stom_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/cus 
> tom_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/cus 
> tom_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 viahttp://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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to