Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Whenever generates wrong cron output for RVM #88

Closed
lexer opened this issue Oct 8, 2010 · 4 comments
Closed

Whenever generates wrong cron output for RVM #88

lexer opened this issue Oct 8, 2010 · 4 comments

Comments

@lexer
Copy link

lexer commented Oct 8, 2010

Whenever generates wrong cron output for RVM.

I've got following code in scheduling.rb

every 1.minutes do
  rake "keekme:import_twitter", :output => {:error => 'error.log', :standard =>  'cron.log'}
end

produces:

# Begin Whenever generated tasks for: /home/administrator/www/keekme/config/schedule.rb
PATH=/usr/local/rvm/gems/ruby-1.9.2-p0/bin:/bin:/usr/local/rvm/rubies/ruby-1.9.2-p0/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

  * * * * * cd /home/administrator/www/keekme && RAILS_ENV=production /usr/bin/env rake keekme:import_twitter >> cron.log 2>> error.log
# End Whenever generated tasks for: /home/administrator/www/keekme/config/schedule.rb

After running this task in crontab error.log i will get following error:

/usr/local/rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/rubygems.rb:340:in `bin_path': can't find executable rake for rake-0.8.7 (Gem::Exception)
from /usr/local/rvm/gems/ruby-1.9.2-p0/bin/rake:19:in `<main>'

I have manually fixed issue.

Here is the corrected cron output that works:
#Begin Whenever generated tasks for: /home/administrator/www/keekme/config/schedule.rb
PATH=/usr/local/rvm/gems/ruby-1.9.2-p0/bin:/bin:/usr/local/rvm/rubies/ruby-1.9.2-p0/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

* * * * * cd /home/administrator/www/keekme && RAILS_ENV=production /usr/local/bin/rake keekme:import_twiiter --trace >> cron.log 2>> error.log

# End Whenever generated tasks for: /home/administrator/www/keekme/config/schedule.rb

I'm using RVM system wide install and ruby 1.9.2.

@javan
Copy link
Owner

javan commented Oct 14, 2010

What if whenever just called rake instead of /usr/bin/env rake and let the PATH deal with including the location for rake?

@lexer
Copy link
Author

lexer commented Oct 17, 2010

even if /usr/local/bin/ is added to path, i'm still cannot run rake without adding full path: /usr/local/bin/rake

@javan
Copy link
Owner

javan commented Oct 20, 2010

This should be fixed with the new release of Whenever (0.6.1). See the README for details.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants