Capistrano 错误 - 无效选项:known_hosts

Capistrano error - Invalid options(s): known_hosts

我正在尝试将 Capistrano 设置为我的同事在我正在处理的子项目上工作的概念证明,该子项目有自己的服务器。

我已经完成所有配置,只需要 运行 首次部署,SSH 转发全部正常,等等...但是我遇到了以前从未见过的错误并且找不到任何关于如何解决的参考:

    andrefigueira@Ubuntu ~/Code/dashboard $ cap slimqa01 deploy --trace
** Invoke slimqa01 (first_time)
** Execute slimqa01
** Invoke load:defaults (first_time)
** Execute load:defaults
** Invoke deploy (first_time)
** Execute deploy
** Invoke deploy:starting (first_time)
** Execute deploy:starting
** Invoke deploy:check (first_time)
** Execute deploy:check
** Invoke git:check (first_time)
** Invoke git:wrapper (first_time)
** Execute git:wrapper
00:00 git:wrapper
      01 mkdir -p /tmp/dashboard-capistrano/
cap aborted!
ArgumentError: invalid option(s): known_hosts
/usr/lib/ruby/vendor_ruby/net/ssh.rb:194:in `start'
/var/lib/gems/2.3.0/gems/sshkit-1.11.0/lib/sshkit/backends/connection_pool.rb:59:in `call'
/var/lib/gems/2.3.0/gems/sshkit-1.11.0/lib/sshkit/backends/connection_pool.rb:59:in `with'
/var/lib/gems/2.3.0/gems/sshkit-1.11.0/lib/sshkit/backends/netssh.rb:149:in `with_ssh'
/var/lib/gems/2.3.0/gems/sshkit-1.11.0/lib/sshkit/backends/netssh.rb:102:in `execute_command'
/var/lib/gems/2.3.0/gems/sshkit-1.11.0/lib/sshkit/backends/abstract.rb:141:in `block in create_command_and_execute'
/var/lib/gems/2.3.0/gems/sshkit-1.11.0/lib/sshkit/backends/abstract.rb:141:in `tap'
/var/lib/gems/2.3.0/gems/sshkit-1.11.0/lib/sshkit/backends/abstract.rb:141:in `create_command_and_execute'
/var/lib/gems/2.3.0/gems/sshkit-1.11.0/lib/sshkit/backends/abstract.rb:74:in `execute'
/var/lib/gems/2.3.0/gems/capistrano-3.5.0/lib/capistrano/tasks/git.rake:16:in `block (3 levels) in <top (required)>'
/var/lib/gems/2.3.0/gems/sshkit-1.11.0/lib/sshkit/backends/abstract.rb:29:in `instance_exec'
/var/lib/gems/2.3.0/gems/sshkit-1.11.0/lib/sshkit/backends/abstract.rb:29:in `run'
/var/lib/gems/2.3.0/gems/sshkit-1.11.0/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute'
Tasks: TOP => git:check => git:wrapper
The deploy has failed with an error: invalid option(s): known_hosts
** Invoke deploy:failed (first_time)
** Execute deploy:failed

** DEPLOY FAILED

所以我认为 Capistrano 正在尝试 运行 一些带有 known_hosts 的选项,但是它试图 运行 它反对的东西不识别该选项,因此不识别部署在它甚至试图联系服务器之前就死了,当我在 cap slimqa01 deploy.

上按回车键时,故障几乎立即发生

有人遇到过类似的问题吗?

deploy.rb 下面:

# config valid only for current version of Capistrano
lock '3.5.0'

set :application, 'dashboard-capistrano'
set :repo_url, 'git@github.com:private/repo.git'

# Default branch is :master
ask :branch, `git rev-parse --abbrev-ref HEAD`.chomp

# Default deploy_to directory is /var/www/my_app_name
set :deploy_to, '/var/www/dashboard-capistrano'

# Default value for :scm is :git
set :scm, :git

# Default value for :format is :airbrussh.
set :format, :airbrussh

# You can configure the Airbrussh format using :format_options.
# These are the defaults.
set :format_options, command_output: true, log_file: 'log/capistrano.log', color: :auto, truncate: :auto

# Default value for :pty is false
# set :pty, true

# Default value for :linked_files is []
# set :linked_files, fetch(:linked_files, []).push('config/database.yml', 'config/secrets.yml')

# Default value for linked_dirs is []
# set :linked_dirs, fetch(:linked_dirs, []).push('log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'public/system')

# Default value for default_env is {}
# set :default_env, { path: "/opt/ruby/bin:$PATH" }

# Default value for keep_releases is 5
set :keep_releases, 5

set :ssh_options, {
   verbose: :debug
}

task :whoami do
    on roles(:web) do
        execute :whoami
    end
end

namespace :deploy do

    after :restart, :clear_cache do
        on roles(:web), in: :groups, limit: 3, wait: 10 do
            # Here we can do anything such as:
            # within release_path do
            #   execute :rake, 'cache:clear'
            # end
        end
    end

end

我也只在 运行 宁个人任务上遇到错误:

andrefigueira@Ubuntu ~/Code/dashboard $ cap slimqa01 whoami
00:00 whoami
      01 whoami
(Backtrace restricted to imported tasks)
cap aborted!
ArgumentError: invalid option(s): known_hosts

Tasks: TOP => whoami
(See full trace by running task with --trace)

我有同样的问题。
将 net-ssh 从 3.0.2 更新到 3.1.1 后,它正在工作。

gem update net-ssh