[英]Deploying with capistrano 3 and whenever gem
I'm trying to deploy my app with whenever
gem using capistrano 3
. 我正在尝试使用capistrano 3
whenever
gem上部署我的应用程序。
I added: require "whenever/capistrano"
to Capfile, and: 我添加了:对Capfile require "whenever/capistrano"
,并且:
set :whenever_identifier, ->{ "#{fetch(:application)}_#{fetch(:stage)}" }
to config/deploy.rb. set :whenever_identifier, ->{ "#{fetch(:application)}_#{fetch(:stage)}" }
到config / deploy.rb。
When I deploy it I get an error: 部署它时出现错误:
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'
When I ssh to production machine and try to run whenever manually with: /home/deploy/www/laptophits/shared/bundle/ruby/2.2.0/bin/whenever
当我通过SSH进入生产机器并尝试通过以下任何方式手动运行时: /home/deploy/www/laptophits/shared/bundle/ruby/2.2.0/bin/whenever
I get error: 我得到错误:
/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'
Any idea how to fix it? 知道如何解决吗?
The key error is in 关键错误在
NameError: undefined local variable or method `extract' for #<Whenever::JobList:0x00000002edf6c8>
config/schedule.rb:9:in `block in initialize'
There's likely a code bug on line 9 of config/schedule.rb
. config/schedule.rb
第9行可能存在代码错误。 Probably using the method extract
which doesn't exist on the object or in the context in which you are using it. 可能使用的方法extract
在对象或使用它的上下文中不存在。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.