whenever icon indicating copy to clipboard operation
whenever copied to clipboard

TypeError: no implicit conversion of nil into Hash

Open firedev opened this issue 8 years ago • 4 comments

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.

firedev avatar Mar 15 '16 11:03 firedev

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.

firedev avatar Mar 16 '16 03:03 firedev

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?

benlangfeld avatar Jun 12 '16 17:06 benlangfeld

I had to copy the load:defaults into my own deploy.rb

qwertme avatar Sep 03 '19 21:09 qwertme

Same issue here

shqear93 avatar Dec 04 '19 01:12 shqear93