Created
May 19, 2014 16:16
-
-
Save hectorperez/49ca148209767ebeac0b to your computer and use it in GitHub Desktop.
Requiring a Ruby Gem in Ruby Script breaks Cron Job Execution: rvm cron setup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You need to setup your crontab with rvm e.g: | |
rvm cron setup | |
With that rvm sets your environment variables in your crontab file | |
then you have a crontab file having this at the top: | |
PATH="/usr/local/rvm/gems/ruby-1.9.3-p194/bin:/usr/local/rvm/gems/ruby-1.9.3-p194@global/bin:/usr/local/rvm/rubies/ruby-1.9.3-p194/bin:/usr/local/rvm/bin:/usr/local/rvm/gems/ruby-1.9.3-p194/bin:/usr/local/rvm/gems/ruby-1.9.3-p194@global/bin:/usr/local/rvm/rubies/ruby-1.9.3-p194/bin:/usr/local/rvm/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/rvm/gems/ruby-1.9.3-p194@global/" | |
rvm_env_string='ruby-1.9.3-p194' | |
rvm_path='/usr/local/rvm' | |
rvm_ruby_string='ruby-1.9.3-p194' | |
RUBY_VERSION='ruby-1.9.3-p194' | |
GEM_HOME='/usr/local/rvm/gems/ruby-1.9.3-p194' | |
GEM_PATH='/usr/local/rvm/gems/ruby-1.9.3-p194:/usr/local/rvm/gems/ruby-1.9.3-p194@global' | |
MY_RUBY_HOME='/usr/local/rvm/rubies/ruby-1.9.3-p194' | |
IRBRC='/usr/local/rvm/rubies/ruby-1.9.3-p194/.irbrc' | |
Then you can stick your crontask beneath it | |
Source: | |
http://stackoverflow.com/questions/20672583/requiring-a-ruby-gem-in-ruby-script-breaks-cron-job-execution |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment