Capistrano 3“上传”任务会引发错误

时间:2013-11-16 12:21:14

标签: ruby capistrano capistrano3

我有capistrano 3任务

namespace :db do
  desc "serurely manages dbconn file after deploy"
  task :dbconfig do
    on roles(:web) do |host|
      upload("config/deploy/dbconn.template.php", "#{shared_path}/dbconn.php")
    end
  end
end

跑步时 cap staging db:dbconfig 我收到错误

   cap aborted!
   undefined method `upload' for #<SSHKit::Backend::Netssh:0x007ffe9a84b9f8>

根据capistrano API,我可以使用此方法上传文件,我也在sshkit lib的源代码中找到它

宝石清单

*** LOCAL GEMS ***
bundler (1.3.5)
capistrano (3.0.1)
CFPropertyList (2.2.0)
i18n (0.6.5)
libxml-ruby (2.6.0)
net-scp (1.1.2)
net-ssh (2.7.0)
nokogiri (1.5.6)
rake (10.1.0)
sqlite3 (1.3.7)
sshkit (1.1.0)
term-ansicolor (1.2.2)
tins (0.13.1)

1 个答案:

答案 0 :(得分:8)

该方法似乎被称为upload!https://github.com/capistrano/sshkit/blob/master/EXAMPLES.md#upload-a-file-from-disk

你在哪里看到它的记录很糟糕,也许你可以向他们发送拉动请求来修复他们的文档?