我一直试图从链接中运行基本的capistrano示例:
https://github.com/capistrano/capistrano/wiki/2.x-Getting-Started
task :search_libs, :hosts => "www.capify.org" do
run "ls -x1 /usr/lib | grep -i xml"
end
我保存在一个名为capfile的文件中,我这样做,
$ cap capfile
并收到以下错误:
➜ capistrano cap --trace capfile
cap aborted!
NameError: undefined local variable or method `tasks_without_stage_dependency' for #<Capistrano::Application:0x007ff1734c8e40>
/Users/Dhruv/.rvm/gems/ruby-2.1.1/gems/capistrano-3.2.1/lib/capistrano/application.rb:24:in `top_level_tasks'
/Users/Dhruv/.rvm/gems/ruby-2.1.1/gems/rake-10.2.2/lib/rake/application.rb:106:in `block in top_level'
/Users/Dhruv/.rvm/gems/ruby-2.1.1/gems/rake-10.2.2/lib/rake/application.rb:115:in `run_with_threads'
/Users/Dhruv/.rvm/gems/ruby-2.1.1/gems/rake-10.2.2/lib/rake/application.rb:100:in `top_level'
/Users/Dhruv/.rvm/gems/ruby-2.1.1/gems/rake-10.2.2/lib/rake/application.rb:78:in `block in run'
/Users/Dhruv/.rvm/gems/ruby-2.1.1/gems/rake-10.2.2/lib/rake/application.rb:176:in `standard_exception_handling'
/Users/Dhruv/.rvm/gems/ruby-2.1.1/gems/rake-10.2.2/lib/rake/application.rb:75:in `run'
/Users/Dhruv/.rvm/gems/ruby-2.1.1/gems/capistrano-3.2.1/lib/capistrano/application.rb:15:in `run'
/Users/Dhruv/.rvm/gems/ruby-2.1.1/gems/capistrano-3.2.1/bin/cap:3:in `<top (required)>'
/Users/Dhruv/.rvm/gems/ruby-2.1.1/bin/cap:23:in `load'
/Users/Dhruv/.rvm/gems/ruby-2.1.1/bin/cap:23:in `<main>'
/Users/Dhruv/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `eval'
/Users/Dhruv/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `<main>'
我的红宝石版本:ruby 2.1.1p76(2014-02-24修订版45161)[x86_64-darwin13.0] Cap版本:Capistrano版本:3.2.1(耙子版本:10.2.2)
答案 0 :(得分:2)
您提供的文档适用于Capistrano v2,使用新文档http://capistranorb.com/
在您的情况下,您需要http://capistranorb.com/documentation/getting-started/preparing-your-application
中的第4步