1

我正在尝试使用whenevergem部署我的应用程序capistrano 3

我添加:require "whenever/capistrano"到 Capfile,并且:

set :whenever_identifier, ->{ "#{fetch(:application)}_#{fetch(:stage)}" } 配置/部署.rb。

当我部署它时,我收到一个错误:

01 bundler: failed to load command: whenever (/home/deploy/www/laptophits/shared/bundle/ruby/2.2.0/bin/whenever)

NameError: undefined local variable or method `extract' for #<Whenever::JobList:0x00000002edf6c8>
      config/schedule.rb:9:in `block in initialize'

当我 ssh 到生产机器并尝试手动运行时:/home/deploy/www/laptophits/shared/bundle/ruby/2.2.0/bin/whenever

我得到错误:

/home/deploy/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems.rb:271:in `find_spec_for_exe': can't find gem whenever (>= 0.a) (Gem::GemNotFoundException)
        from /home/deploy/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems.rb:299:in `activate_bin_path'

知道如何解决吗?

4

1 回答 1

1

关键错误在

NameError: undefined local variable or method `extract' for #<Whenever::JobList:0x00000002edf6c8>
  config/schedule.rb:9:in `block in initialize'

的第 9 行可能存在代码错误config/schedule.rb。可能使用extract对象上或您使用它的上下文中不存在的方法。

于 2017-06-01T23:49:06.277 回答