ruby-on-rails – SSHKit :: Runner :: ExecuteError

前端之家收集整理的这篇文章主要介绍了ruby-on-rails – SSHKit :: Runner :: ExecuteError前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
$bundle exec cap production部署

(Backtrace restricted to imported tasks) cap aborted!

SSHKit::Runner::ExecuteError:


Exception while executing as Psara@sakura: git exit status: 128 git stdout: Nothing written git
stderr: Permission denied (publickey).


fatal: The remote end hung up unexpectedly@H_301_13@

SSHKit::Command::Failed:


git exit status: 128

git stdout:Nothing written

git stderr: Permission denied (publickey).


fatal: The remote end hung up unexpectedly@H_301_13@

Tasks: TOP => git:check (See full trace by running task with –trace)
The deploy has Failed with an error:


Exception while executing as Psara@sakura:


git exit status: 128 git stdout: Nothing written


git stderr: Permission denied (publickey).@H_301_13@

fatal: The remote end hung up unexpectedly@H_301_13@

*@H_301_13@

deploy.rb@H_301_13@

set :application,‘Psara’
set :repo_url,‘git@bitbucket.org:CBLaughter/psara.git’
set :deploy_to,‘/home/Psara/Psara’
set :default_run_options,:pty => true@H_301_13@

namespace :deploy do@H_301_13@

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@H_301_13@

end@H_301_13@

set :ssh_options,{ forward_agent: true,paranoid: true,keys:
“~/.ssh/id_rsa” }@H_301_13@

*@H_301_13@

production.rb@H_301_13@

set :stage,:staging

set :rails_env,:production
@H_301_13@

role :app,%w{sakura}

role :web,%w{sakura}

role :db,%w{sakura}
@H_301_13@

server ‘sakura’,user: ‘Psara’,roles: %w{web app},my_property: >:my_value @H_301_13@

set :ssh_options,{

keys: %w(~/.ssh/id_rsa),

forward_agent: false,}@H_301_13@

我会很高兴,如果你能教我能做什么来解决这个问题.@H_301_13@

我已经在bitbucket上添加了一个公钥,但它不起作用.@H_301_13@

*@H_301_13@

SSH代理转发报告@H_301_13@


  1. [success] repo_url setting ok@H_301_13@

  2. [success] ssh private key file exists@H_301_13@

  3. [success] ssh-agent process seems to be running locally@H_301_13@

  4. [success] ssh-agent process recognized by ssh-add command@H_301_13@

  5. [success] ssh private keys added to ssh-agent@H_301_13@

  6. [success] application repository accessible from local machine@H_301_13@

  7. [success] all hosts using passwordless login@H_301_13@

  8. [success] forward_agent ok for all hosts@H_301_13@

  9. [success] ssh agent successfully forwarded to remote hosts@H_301_13@

  10. [success] application repository accessible from remote hosts@H_301_13@


It seems SSH agent forwarding is set up correctly! You can continue
with the deployment process.@H_301_13@

It succeeded in all tests,but still makes same error.@H_301_13@

解决方法

确保您的机器上运行ssh代理,因为您正在使用ssh转发,您的本地密钥应该能够访问并从bitbucket克隆您的repo.你可以运行代理它:
eval `ssh-agent`
ssh-add ~/.ssh/id_rsa

关于ssh转发的更多信息可以find here.@H_301_13@

您应该手动检查的其他事情是,您可以将ssh连接到服务器(您的公钥应该添加到服务器上的〜/ .ssh / authorized_keys),当然,您可以在本地克隆您的回购(这可能是您可以做).@H_301_13@

更新:@H_301_13@

现在我已经意识到你转向生产,在这种情况下,你应该确保你的服务器上的密钥对(你必须拥有它,因为转发关闭),可以从bitbucket克隆repo,你可以尝试手工克隆在服务器上.@H_301_13@

猜你在找的Ruby相关文章