简体   繁体   English

不可执行:bin / rails每当使用gem时

[英]not executable: bin/rails using whenever gem

I am using whenever gem to run my model method(cron job) 我正在使用每当gem运行我的模型方法(定时作业)

My steps to install whenever gem is whenever gem我的安装步骤

Gemfile 的Gemfile

gem 'whenever', :require => false

In project path type 在项目路径中

wheneverize .

In schedule.rb 在schedule.rb中

set :output, {:error => "log/cron_error_log.log", :standard => "log/cron_log.log"}
every 1.minute do
  runner 'Invoice.mark_as_overdue'
end

And when I check cron_log.log file its showing error 当我检查cron_log.log文件时,显示错误

bundler: not executable: bin/rails

Any suggestion will be appreciate 任何建议将不胜感激

您可以尝试Rufus-Scheduler gem,它更容易在Ruby中实现调度

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM