On May 20, 1:11 pm, Frederick Cheung <[email protected]>
wrote:
> On May 20, 10:12 am, Tushar Gandhi <[email protected]> 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.
>
Just noticed that you are explicitly setting the path to ruby, however
i think rvm also sets up environment variables that tell ruby where
gems are and so on.
Fred
> 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 [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.