gpt4 book ai didi

ruby-on-rails - 如何修复 capistrano 部署? git 退出状态 : 1

转载 作者:行者123 更新时间:2023-12-05 01:04:03 25 4
gpt4 key购买 nike

我在我的应用程序中使用 Capistrano 3.2.1 和 Rails 4.0。我正在尝试从我的 github 存储库安装 gem。但它不起作用。我不知道是怎么回事。当我跑 ssh -T git@github.com在我的服务器上它成功了。但是当我运行 cap production deploy我收到以下错误:

DEBUG [d89fd157]  000a0d807aabdb327d80bbe21d5212e62142f9ca  refs/tags/staging-2014-05-22-15-58-38-0400^{}
DEBUG [d89fd157] 1cbcc8350316c7511035f1ef85f1f8d177197a24 refs/tags/staging-2014-05-22-16-55-02-0400
DEBUG [d89fd157] 5e905411ca362abe83fdbfbb4aa81222945dcecc refs/tags/staging-2014-05-22-16-55-02-0400^{}
DEBUG [d89fd157] fa200661a9791aefa41318a54c3fee477a246ece refs/tags/staging-2014-05-22-20-01-16-0400
DEBUG [d89fd157] 665fd3d871e75f6b092c11572c23e126d139d9d9 refs/tags/staging-2014-05-22-20-01-16-0400^{}
DEBUG [d89fd157] 84b23c1e93c47d91d4a442866d83a9e275428369 refs/tags/staging-2014-05-23-11-27-24-0400
DEBUG [d89fd157] 10a2c4dab3e76eb05ba07b18392f92bcc7e30ccf refs/tags/staging-2014-05-23-11-27-24-0400^{}
DEBUG [d89fd157] b7ca8b7bcad98e4160deb06df6688153e372f658 refs/tags/staging-2014-05-28-22-48-47-0530
DEBUG [d89fd157] f69bf3a92ad5ef65cb9425428be0446c2459143a refs/tags/staging-2014-05-28-22-48-47-0530^{}
DEBUG [d89fd157] 62a2a29e5c88e3603666826421cb1ea28f78423c refs/tags/staging-2014-05-29-00-46-10-0530
DEBUG [d89fd157] f69bf3a92ad5ef65cb9425428be0446c2459143a refs/tags/staging-2014-05-29-00-46-10-0530^{}
DEBUG [d89fd157] 960e24c40e0ab7207f92812f34015ae41a307e7e refs/tags/staging-2014-05-29-00-51-04-0530
DEBUG [d89fd157] f69bf3a92ad5ef65cb9425428be0446c2459143a refs/tags/staging-2014-05-29-00-51-04-0530^{}
DEBUG [d89fd157] Finished in 2.876 seconds with exit status 0 (successful).
INFO [dc211684] Running /usr/bin/env mkdir -pv /data/apps/myautobrain/shared /data/apps/myautobrain/releases on 107.170.168.224
DEBUG [dc211684] Command: ( RAILS_ENV=staging RBENV_ROOT=/data/rbenv RBENV_VERSION=2.1.1 /usr/bin/env mkdir -pv /data/apps/myautobrain/shared /data/apps/myautobrain/releases )
INFO [dc211684] Finished in 1.669 seconds with exit status 0 (successful).
INFO [3b633fa7] Running /usr/bin/env mkdir -pv /data/apps/myautobrain/shared/log /data/apps/myautobrain/shared/tmp /data/apps/myautobrain/shared/vendor/bundle /data/apps/myautobrain/shared/db/backups /data/apps/myautobrain/shared/config/settings on 107.170.168.224
DEBUG [3b633fa7] Command: ( RAILS_ENV=staging RBENV_ROOT=/data/rbenv RBENV_VERSION=2.1.1 /usr/bin/env mkdir -pv /data/apps/myautobrain/shared/log /data/apps/myautobrain/shared/tmp /data/apps/myautobrain/shared/vendor/bundle /data/apps/myautobrain/shared/db/backups /data/apps/myautobrain/shared/config/settings )
INFO [3b633fa7] Finished in 1.646 seconds with exit status 0 (successful).
INFO [1581b4a0] Running /usr/bin/env mkdir -pv /data/apps/myautobrain/shared/config on 107.170.168.224
DEBUG [1581b4a0] Command: ( RAILS_ENV=staging RBENV_ROOT=/data/rbenv RBENV_VERSION=2.1.1 /usr/bin/env mkdir -pv /data/apps/myautobrain/shared/config )
INFO [1581b4a0] Finished in 1.691 seconds with exit status 0 (successful).
DEBUG [48a6c211] Running /usr/bin/env [ -f /data/apps/myautobrain/shared/config/database.yml ] on 107.170.168.224
DEBUG [48a6c211] Command: [ -f /data/apps/myautobrain/shared/config/database.yml ]
DEBUG [48a6c211] Finished in 1.676 seconds with exit status 0 (successful).
DEBUG [0a11405e] Running /usr/bin/env [ -f /data/apps/myautobrain/shared/config/database.yml ] on 107.170.168.224
DEBUG [0a11405e] Command: [ -f /data/apps/myautobrain/shared/config/database.yml ]
DEBUG [0a11405e] Finished in 1.575 seconds with exit status 0 (successful).
DEBUG [2c1a88cc] Running /usr/bin/env [ $(which nodejs || which node ) ] on 107.170.168.224
DEBUG [2c1a88cc] Command: [ $(which nodejs || which node ) ]
DEBUG [2c1a88cc] Finished in 1.560 seconds with exit status 0 (successful).
INFO Javascript runtime nodejs is available on 107.170.168.224
DEBUG [5c2090dd] Running /usr/bin/env [ $(which identify) ] on 107.170.168.224
DEBUG [5c2090dd] Command: [ $(which identify) ]
DEBUG [5c2090dd] Finished in 1.643 seconds with exit status 0 (successful).
INFO Javascript runtime nodejs is available on 107.170.168.224
DEBUG [51feab0b] Running /usr/bin/env [ -f /data/apps/myautobrain/repo/HEAD ] on 107.170.168.224
DEBUG [51feab0b] Command: [ -f /data/apps/myautobrain/repo/HEAD ]
DEBUG [51feab0b] Finished in 1.620 seconds with exit status 0 (successful).
INFO The repository mirror is at /data/apps/myautobrain/repo
DEBUG [60a484d1] Running /usr/bin/env if test ! -d /data/apps/myautobrain/repo; then echo "Directory does not exist '/data/apps/myautobrain/repo'" 1>&2; false; fi on 107.170.168.224
DEBUG [60a484d1] Command: if test ! -d /data/apps/myautobrain/repo; then echo "Directory does not exist '/data/apps/myautobrain/repo'" 1>&2; false; fi
DEBUG [60a484d1] Finished in 1.592 seconds with exit status 0 (successful).
DEBUG [be3246e2] Running /usr/bin/env cd /data/apps/myautobrain/repo && git rev-parse --short HEAD on 107.170.168.224
DEBUG [be3246e2] Command: cd /data/apps/myautobrain/repo && git rev-parse --short HEAD
DEBUG [be3246e2] 3dbe0cd
DEBUG [be3246e2]
DEBUG [be3246e2] Finished in 0.194 seconds with exit status 0 (successful).
INFO [375571f4] Running /usr/bin/env git remote update on 107.170.168.224
DEBUG [375571f4] Command: cd /data/apps/myautobrain/repo && ( RAILS_ENV=staging RBENV_ROOT=/data/rbenv RBENV_VERSION=2.1.1 GIT_ASKPASS=/bin/echo GIT_SSH=/data/tmp/myautobrain/git-ssh.sh /usr/bin/env git remote update )
DEBUG [375571f4] Fetching origin
DEBUG [375571f4]
DEBUG [375571f4] ERROR: Repository not found.
DEBUG [375571f4]
DEBUG [375571f4] fatal: The remote end hung up unexpectedly
DEBUG [375571f4]
DEBUG [375571f4] error: Could not fetch origin
DEBUG [375571f4]
cap aborted!
git exit status: 1
git stdout: Nothing written
git stderr: Nothing written

Tasks: TOP => git:create_release => git:update
(See full trace by running task with --trace)
The deploy has failed with an error: #<SSHKit::Command::Failed: git exit status: 1
git stdout: Nothing written
git stderr: Nothing written
>

这是 deploy.rb :
set :rbenv_type, :user # or :system, depends on your rbenv setup
set :rbenv_ruby, '2.1.1'

#TODO: Check the application name
set :application, 'myautobrain'

#TODO: Replace with valid github url
set :repo_url, 'git@github.com:swjg-ventures/myautobrain.git'

ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp }

set :deploy_to, "/data/apps/#{fetch(:application)}"
set :scm, :git

set :format, :pretty
set :log_level, :debug
set :pty, true

set :linked_files, %w{config/database.yml}
set :linked_dirs, %w{log tmp vendor/bundle db/backups config/settings}

# set :default_env, { path: "/opt/ruby/bin:$PATH" }
set :keep_releases, 5

set :bundle_without, %w{development test utils}.join(' ')

set :git_tag_name, proc { Time.now.to_s.gsub(/[-\s\:\+]+/, '-') }

before 'deploy:migrate', 'db:backup'
after 'deploy:finishing', 'deploy:restart'
after 'deploy:finishing', 'deploy:cleanup'

从服务器:
deployer@myautobrain-staging:~$ ls -l ~/.ssh
total 20
-rw------- 1 deployer deployer 4815 May 28 17:57 authorized_keys
-rw------- 1 deployer deployer 1675 May 28 17:29 id_rsa
-rw-r--r-- 1 deployer deployer 404 May 28 17:29 id_rsa.pub
-rw-r--r-- 1 deployer deployer 2210 May 28 13:17 known_hosts

这个过程中最令人沮丧的部分是这个过程在我同事的电脑上运行。

任何的想法?如果您需要更多信息,请告诉我。

最佳答案

尝试部署我的应用程序时出现此错误,我需要做的就是:
remove ${deploy_dir}/repo并成功部署。

在我的情况下,我已经从 https://github.com 改变了至 https://bitbucket.org

来自 github 的所有配置仍在 ${deploy_dir}/repo 中。

关于ruby-on-rails - 如何修复 capistrano 部署? git 退出状态 : 1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23920550/

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