Undefined method 'zero?' for nil:NilClass (NoMethodError)

911 Views Asked by At

I added the whenever Gem to my project. I added this code to my deploy.rb as instructed.

set :whenever_command, "bundle exec whenever"
require "bundler/capistrano"
require "whenever/capistrano"

I got the following error when I tried to run cap deploy. Any ideas? My schedule.rb is commented out so it is not that. My ruby is 2.1.3 and rails is 4.1.8. This happens when it executes `whenever:update_crontab'.

** [out :: mydomain] /path/to/app/shared/bundle/ruby/2.1.0/gems/whenever-0.9.4/lib/whenever/command_line.rb:77:in `write_crontab':
** [out :: mydomain] undefined method `zero?' for nil:NilClass (NoMethodError)
** [out :: mydomain] from /path/to/app/shared/bundle/ruby/2.1.0/gems/whenever-0.9.4/lib/whenever/command_line.rb:35:in `run
1

There are 1 best solutions below

0
On

Seems I needed an existing cron tab on the server for this to work. After I added one using "crontab -e", I was able to deploy successfully.