gpt4 book ai didi

php - Capistrano 错误 - 无效选项 : known_hosts

转载 作者:太空宇宙 更新时间:2023-11-03 18:09:03 26 4
gpt4 key购买 nike

我正在尝试将 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 上按下 enter 键后立即。

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

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 更新 net-ssh

关于php - Capistrano 错误 - 无效选项 : known_hosts,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37865299/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com