橡胶宝石+每当Gem =错误无法加载此类文件 - bundler / setup

时间:2012-12-09 21:27:43

标签: ruby-on-rails cron whenever

我希望你有关于我如何拥有橡胶cron以及每当cron生活在一起的建议?正如您在下面的crontab -l输出中所看到的,橡胶cron作业想要设置PATH变量。这导致Whenever创建的cron作业失败。如果我注释掉PATH变量,则橡胶cron作业失败,因为它们找不到rvm。任何帮助都将是非常值得赞赏的。

这是我的crontab -l <​​/ p>的输出

# cron clears out environment variables, but Rubber.root/script/rubber uses
# "rvm do default" to run, so no longer any need to setup ruby env vars here,
# all we need is PATH
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/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
# don't need to set RUBBER_ENV for each script since we set it for all cron here
RUBBER_ENV=production
RAILS_ENV=production

# Roll all rails logs at midnight
0 0 * * * /mnt/stats-production/releases/20121209201953/script/rubber cron --task util:rotate_logs --directory=/mnt/stats-production/releases/20121209201953/log
# rubber-nginx-start

# Roll the nginx logs at midnight
0 0 * * * /mnt/stats-production/releases/20121209201953/script/rubber cron --task util:rotate_logs --directory=/mnt/nginx/logs
# rubber-nginx-end

# Begin Whenever generated tasks for: stats
0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57 * * * * /bin/bash -l -c 'cd /mnt/stats-production/releases/20121209201953 && script/rails runner -e production '\''Region.queue_worker'\'''

# End Whenever generated tasks for: stats

我收到的错误:

stdin: is not a tty
/usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- bundler/setup (LoadError)
    from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /mnt/stats-production/releases/20121209201953/config/boot.rb:6:in `<top (required)>'
    from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from script/rails:5:in `<main>'

0 个答案:

没有答案