我正在将我的应用从capistrano v2升级到v3。当我运行安装任务时,抛出以下错误
$ cap development deploy:setup
cap aborted!
Don't know how to build task 'deploy:setup'
/home/user/.rvm/gems/ruby-2.0.0-p353@user-ui/gems/capistrano-3.0.1/lib/capistrano/application.rb:12:in `run'
/home/user/.rvm/gems/ruby-2.0.0-p353@user-ui/gems/capistrano-3.0.1/bin/cap:3:in `<top (required)>'
/home/user/.rvm/gems/ruby-2.0.0-p353@user-ui/bin/cap:23:in `load'
/home/user/.rvm/gems/ruby-2.0.0-p353@user-ui/bin/cap:23:in `<main>'
/home/user/.rvm/gems/ruby-2.0.0-p353@user-ui/bin/ruby_executable_hooks:15:in `eval'
/home/user/.rvm/gems/ruby-2.0.0-p353@user-ui/bin/ruby_executable_hooks:15:in `<main
/application.rb(它指出第12行是超级的)
def run
Rake.application = self
super
end
Capfile
require 'capistrano/setup'
require 'capistrano/deploy'
require 'capistrano/rvm'
require 'capistrano/bundler'
Dir.glob('lib/capistrano/tasks/*.cap').each { |r| import r }
$ gem list capistrano
*本地宝石*
capistrano(3.0.1)
capistrano-bundler(1.1.1)
capistrano-rails(1.0.0)
capistrano-rvm(0.0.3)
capistrano-unicorn(0.2.0)。
如果我的错误被指出,任何帮助将不胜感激。感谢。
答案 0 :(得分:0)
您应该在部署命令之前加上“bundle exec”,前提是您没有将capistrano gem打包到bin-stubs中。
尝试: 捆绑exec cap生产部署
运行“bundle exec”将确保您使用的是您期望的Capistrano宝石。另外一定要去掉任何你不需要的多余宝石。
如果问题仍然存在,请回到霍勒身上