TypeError: no implicit conversion of nil into Hash
Hi,
Here is my deploy.rb:
require 'whenever/capistrano'
...
set :whenever_identifier, ->{ "#{fetch(:application)}_#{fetch(:stage)}" }
set :whenever_roles, -> { [:web, :db, :app] }
production.rb
set :rails_env, :production
role :app, %w( ... )
role :web, %w( ... )
role :db, %w( ... )
Yet it fails with the following:
TypeError: no implicit conversion of nil into Hash
gems/sshkit-1.9.0/lib/sshkit/backends/abstract.rb:87:in `merge'
gems/sshkit-1.9.0/lib/sshkit/backends/abstract.rb:87:in `with'
gems/whenever-0.9.4/lib/whenever/tasks/whenever.rake:8:in `block (2 levels) in setup_whenever_task'
gems/sshkit-1.9.0/lib/sshkit/backends/abstract.rb:80:in `within'
gems/whenever-0.9.4/lib/whenever/tasks/whenever.rake:7:in `block in setup_whenever_task'
gems/sshkit-1.9.0/lib/sshkit/backends/abstract.rb:29:in `instance_exec'
gems/sshkit-1.9.0/lib/sshkit/backends/abstract.rb:29:in `run'
gems/sshkit-1.9.0/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute'
Tasks: TOP => whenever:update_crontab
The deploy has failed with an error: no implicit conversion of nil into Hash
gems/whenever-0.9.4/lib/whenever/tasks/whenever.rake:8
with fetch(:whenever_command_environment_variables) do
execute *args_for_host
end
I am using ruby 2.3 and capistrano 3.4.0, the same config works on the other app with the only difference is ruby version being 2.2. Is there anything I am missing?
If I remove whever_roles it doesn't fail but nothing gets added to crontab either.
Please advise, thanks.
I thought it does not add anything to crontab, without whenever_roles, but this morning I've found a bunch of entries referencing /app/releasetimestamp instead of /app/current folder.
Did you by any chance override :whenever_command_environment_variables? The default is {} which should not raise this error. If you use bundle open to log the value of fetch(:whenever_command_environment_variables), is it definitely nil?
I had to copy the load:defaults into my own deploy.rb
Same issue here