- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在尝试将 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/
我是 Capistrano 的新手,我想知道为我的项目管理 Capistrano 配置的最佳方法是什么。 具体应该在哪里config/deploy.rb与我的项目的源代码控制相关吗?我应该存储没有特定
我正在使用 Capistrano 管理在多个负载平衡服务器上运行的 Java Web 应用程序。某些任务(例如配置更改)需要重新启动服务器或重新部署应用程序,在此期间服务器变得无响应。 如果 Capi
有没有办法可以看到 capistrano 任务依赖树?我有一个大项目,有很多任务和依赖项,但我对整个画面一无所知。 帕纳约蒂斯 最佳答案 在 Capistrano 3 中,您可以添加 --trace
我有一个命名空间和一些在 deploy:updated 之后运行的命名空间中的任务。下面是一个例子: namespace :myservice do task :start do on r
我想在运行 deploy:migrate 任务之前停止一些进程。我知道我可以通过复制现有代码并在任务的开头和结尾添加停止/启动步骤来重新定义 deploy:migrate 任务。 我想知道是否有办法避
我将如何更改 Capistrano 使用的临时目录? 示例:代替 /tmp ,我想用/home/user/tmp 我现在的 VPS 有 /tmp安装为 noexec ,这使我在尝试运行时获得了权限被拒
使用 Capistrano,如何回滚到特定版本? 我服务器的文件夹有一个/release 文件夹,我如何回滚到特定的文件夹? 我是否可以在本地获取计算机上的版本列表? 我正在使用 GIT,但这不起作用
我尝试使用“cap rollback”,但出现以下错误: $ cap rollback the task `rollback' does not exist 我需要做一些额外的设置才能使回滚正常工作吗
我正在使用 Capistrano 部署 ruby on Rails 项目。我正在尝试以用户“部署”身份登录远程服务器并部署此应用程序。 当我通过 ssh 进入框进行部署并 git 克隆项目时,它可
我正在使用 Capistrano 部署 ruby on Rails 项目。我正在尝试以用户“部署”身份登录远程服务器并部署此应用程序。 当我通过 ssh 进入框进行部署并 git 克隆项目时,它可
我正在使用 capistrano、capistrano/rbenv、capistrano/bundler 和 capistrano/rails。我在 capistrano 编译 Assets 的步骤中
尝试将此代码块授予 capistrano 的版本 3 但无济于事。一切都变了。任何人都可以帮助我在正确的轨道上进行转换吗? 旧版本 2 deploy.rb: #require 'new_relic/r
我对这两种工具都是新手,还没有完全掌握。 如果我使用 Capistrano 进行部署,为什么 Gradle 是部署目标? 另见 Gradle Overview . 最佳答案 Gradle 是从 Gro
如何使用 Capistrano v3 仅部署到一台服务器?我在那里发现的所有解决方案都部署到每台服务器,因此,我认为它们适用于 v2。 我不想部署一个阶段,我已经在使用多阶段,我只想在其中一个阶段部署
在 Capistrano Multi-staging documentation set :deploy_env, 'production'用来。是 deploy_env同 rails_env其中te
部署应用程序时,我将 Capistrano 与 capistrano_rsync_with_remote_cache gem 一起使用。 使用新软件升级部署服务器后出现问题: 卡皮斯特拉诺 2.5.1
capistrano-chef 是否有替代品?厨师独奏的 gem ?主要是为了避免两次定义服务器信息。 最佳答案 我在这个话题上发现了一些新鲜而热门的东西: Roundsman gem 文件: gem
我正在尝试通过遵循 DOCS 来学习使用 Capistrano 3,并且我编写了一个简单的任务来测试我的理解。 任务在默认 task 中创建目录在 lib/capistrano/tasks : d
我有一个 capistrano 任务,它整合了 Rails 项目的多个阶段的部署。 例如: task :consolidated_task do build #creates a new re
来自 deploy.rb 的片段 task :prod1 do set :deploy_to, "/home/project/src/prod1" end task :prod2 do set
我是一名优秀的程序员,十分优秀!