Open JasonBarnabe opened 8 years ago
Do you have an easy way to reproduce this? On a fresh Ubuntu 14.04 server I cannot.
Seems to be empty crontab + update: true + cut: n.
Tested on CentOS 7.2:
[web@lxap201 current]$ crontab -l
[web@lxap201 current]$ rails runner -e staging "Whenever::CommandLine.execute(cut: 3, update: true)"
/home/web/.rvm/gems/ruby-2.2.3/gems/whenever-0.9.4/lib/whenever/command_line.rb:114:in `prepare': undefined method `join' for nil:NilClass (NoMethodError)
from /home/web/.rvm/gems/ruby-2.2.3/gems/whenever-0.9.4/lib/whenever/command_line.rb:64:in `read_crontab'
from /home/web/.rvm/gems/ruby-2.2.3/gems/whenever-0.9.4/lib/whenever/command_line.rb:92:in `updated_crontab'
from /home/web/.rvm/gems/ruby-2.2.3/gems/whenever-0.9.4/lib/whenever/command_line.rb:35:in `run'
from /home/web/.rvm/gems/ruby-2.2.3/gems/whenever-0.9.4/lib/whenever/command_line.rb:6:in `execute'
from /home/web/.rvm/gems/ruby-2.2.3/gems/railties-4.0.13/lib/rails/commands/runner.rb:53:in `<top (required)>'
from /home/web/.rvm/gems/ruby-2.2.3/gems/railties-4.0.13/lib/rails/commands/runner.rb:53:in `eval'
from /home/web/.rvm/gems/ruby-2.2.3/gems/railties-4.0.13/lib/rails/commands/runner.rb:53:in `<top (required)>'
from /home/web/.rvm/gems/ruby-2.2.3/gems/railties-4.0.13/lib/rails/commands.rb:84:in `require'
from /home/web/.rvm/gems/ruby-2.2.3/gems/railties-4.0.13/lib/rails/commands.rb:84:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
With a blank crontab:
Adding a few blank lines to the crontab makes it work.