javan/whenever

undefined method `exclusive_rake'

hopewise opened this issue · 1 comments

I get this error when try to deploy my app:

01:02 whenever:update_crontab
      01 ~/.rvm/bin/rvm 2.6.6 do bundle exec whenever --update-crontab burglary_com_production --set environment=production --roles=app,db,web 
      01 Traceback (most recent call last):
      01        16: from /var/www/burglary_com/shared/bundle/ruby/2.6.0/bin/ruby_executable_hooks:24:in `<main>'
      01        15: from /var/www/burglary_com/shared/bundle/ruby/2.6.0/bin/ruby_executable_hooks:24:in `eval'
      01        14: from /var/www/burglary_com/shared/bundle/ruby/2.6.0/bin/whenever:23:in `<main>'
      01        13: from /var/www/burglary_com/shared/bundle/ruby/2.6.0/bin/whenever:23:in `load'
      01        12: from /var/www/burglary_com/shared/bundle/ruby/2.6.0/gems/whenever-0.10.0/bin/whenever:44:in `<top (required)>'
      01        11: from /var/www/burglary_com/shared/bundle/ruby/2.6.0/gems/whenever-0.10.0/lib/whenever/command_line.rb:6:in `execute'
      01        10: from /var/www/burglary_com/shared/bundle/ruby/2.6.0/gems/whenever-0.10.0/lib/whenever/command_line.rb:38:in `run'
      01         9: from /var/www/burglary_com/shared/bundle/ruby/2.6.0/gems/whenever-0.10.0/lib/whenever/command_line.rb:109:in `updated_crontab'
      01         8: from /var/www/burglary_com/shared/bundle/ruby/2.6.0/gems/whenever-0.10.0/lib/whenever/command_line.rb:57:in `whenever_cron'
      01         7: from /var/www/burglary_com/shared/bundle/ruby/2.6.0/gems/whenever-0.10.0/lib/whenever.rb:12:in `cron'
      01         6: from /var/www/burglary_com/shared/bundle/ruby/2.6.0/gems/whenever-0.10.0/lib/whenever.rb:12:in `new'
      01         5: from /var/www/burglary_com/shared/bundle/ruby/2.6.0/gems/whenever-0.10.0/lib/whenever/job_list.rb:25:in `initialize'
      01         4: from /var/www/burglary_com/shared/bundle/ruby/2.6.0/gems/whenever-0.10.0/lib/whenever/job_list.rb:25:in `instance_eval'
      01         3: from config/schedule.rb:23:in `initialize'
      01         2: from /var/www/burglary_com/shared/bundle/ruby/2.6.0/gems/whenever-0.10.0/lib/whenever/job_list.rb:51:in `every'
      01         1: from config/schedule.rb:24:in `block in initialize'
      01 /var/www/burglary_com/shared/bundle/ruby/2.6.0/gems/whenever-0.10.0/lib/whenever/job_list.rb:37:in `method_missing':
      01 undefined method `exclusive_rake' for #<Whenever::JobList:0x0000000001d44350> (NoMethodError
      01 
      01 )
(Backtrace restricted to imported tasks)
cap aborted!

my config/schedule.rb

set :output, 'log/cron.log'

every 2.minutes, roles: [:cronjobs] do
  exclusive_rake 'elasticsearch:sync'
end

every 1.day, at: '11:30 pm', roles: [:cronjobs] do
  rake 'crime_reports:create'
end

any idea?

simply, that custom job was not defined