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

时间:2022-09-06 18:25:07

I have capistrano 3 task

我有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

When running cap staging db:dbconfig I get error

在运行cap staging db:dbconfig时,我得到错误。

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

According to capistrano API I can use this method to upload files, i also found it in source code of sshkit lib

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

gem list

宝石列表

*** 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 个解决方案

#1


8  

It appears the method is called upload!: https://github.com/capistrano/sshkit/blob/master/EXAMPLES.md#upload-a-file-from-disk

看来这个方法叫做上载!:https://github.com/capistrano/sshkit/blob/master/EXAMPLES.md upload-a-file-from-disk

Where did you see it badly documented, maybe you could send them a pull request to fix their docs?

你在哪里见过它的糟糕文件,也许你可以给他们发送一个拉请求来修复他们的文档?

#1


8  

It appears the method is called upload!: https://github.com/capistrano/sshkit/blob/master/EXAMPLES.md#upload-a-file-from-disk

看来这个方法叫做上载!:https://github.com/capistrano/sshkit/blob/master/EXAMPLES.md upload-a-file-from-disk

Where did you see it badly documented, maybe you could send them a pull request to fix their docs?

你在哪里见过它的糟糕文件,也许你可以给他们发送一个拉请求来修复他们的文档?