首页 文章

Cron作业捆绑器错误

提问于
浏览
0

我正在尝试创建一个cron作业,运行一个控制器方法与每当宝石,但我遇到了麻烦 . 我越来越

bundler:不可执行:bin / rails

在我的cron.log文件中 .

schedule.rb

every 1.minutes do
  runner "Reset.reset"
end

reset.rb

class Reset < ActiveRecord::Base      
  def self.reset
    logger.debug("This is the cron job")         
  end    
end

我还运行了--update-crontab来更新cron作业 .

为什么 Logger 消息不显示在日志中?

谢谢你的帮助 .

Out put of crontab -l

sm start rvm sm end rvm Begin每当生成的任务为:/home/john/rails_app/config/schedule.rb PATH = / home / john / bin:/home/john/.local/bin:/ usr / local / sbin :在/ usr / local / bin目录:/ usr / sbin目录:在/ usr / bin中:/ sbin目录:/ bin中:在/ usr /游戏:在/ usr /本地/游戏:/ SNAP /斌:/home/john/.rvm/bin GEM_PATH =“”***** / bin / bash -l -c'cd / home / john / rails_app && bundle exec bin / rails runner -e development'''Reset.reset_payments'''>> / home /john/rails_app/log/cron.log 2 >> / home / john / rails_app / log / error.log'结束每当生成的任务为:/home/john/rails_app/config/schedule.rb

1 回答

  • 0

    我最终使用了rake任务而不是使用跑步者 .

相关问题