卡皮斯特拉诺用神秘的信息流产

时间:2016-01-20 22:53:00

标签: ruby-on-rails ruby capistrano capistrano3

我正在尝试使用capistrano部署我的应用,但它失败并显示以下消息。

错误

➜  ..... git:(capistrano) ✗ cap production deploy:check
INFO [98af6015] Running /usr/bin/env mkdir -p /tmp/...-api/ as deploy@0.0.0.0
INFO [98af6015] Finished in 0.239 seconds with exit status 0 (successful).
INFO Uploading /tmp/...-api/git-ssh.sh 100.0%
INFO [36b8dec0] Running /usr/bin/env chmod +x /tmp/...-api/git-ssh.sh as deploy@0.0.0.0
INFO [36b8dec0] Finished in 0.216 seconds with exit status 0 (successful).
Please enter branch (capistrano): 
INFO [fe410248] Running /usr/bin/env git ls-remote --heads  as deploy@0.0.0.0
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as deploy@0.0.0.0: git exit status: 129
git stdout: Nothing written
git stderr: usage: git ls-remote [--heads] [--tags]  [-u <exec> | --upload-pack <exec>] <repository> <refs>...

SSHKit::Command::Failed: git exit status: 129
git stdout: Nothing written
git stderr: usage: git ls-remote [--heads] [--tags]  [-u <exec> | --upload-pack <exec>] <repository> <refs>...

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

deploy.rb

lock '3.4.0'

set :application, '....-api'
set :repository, 'git@github.com:chaione/...-api.git'
set :user, 'deploy'
set :linked_files, fetch(:linked_files, []).push('config/database.yml', 'config/secrets.yml')
set :linked_dirs, fetch(:linked_dirs, []).push('log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'vendor/bundle', 'public/system')
set :format, :pretty
set :log_level, :info
set :deploy_via, :remote_cache

# set :scm, 'git'
ask :branch, `git rev-parse --abbrev-ref HEAD`.chomp

production.rb

server '0.0.0.0', user: 'deploy', roles: %w(web app db), primary: true

set :unicorn_rack_env, -> { "production" }
set :rails_env, :production
set :enable_ssl, true

set :ssh_options,
    keys: %w(~/.ssh/id_rsa),
    forward_agent: false,
    auth_methods: %w(password publickey),
    password: '....'

1 个答案:

答案 0 :(得分:0)

问题是服务器在服务器上没有部署密钥。所以我必须生成一个密钥并将其添加到github上。