gpt4 book ai didi

ruby-on-rails - 使用 rvm 和 git 部署 Capistrano [git 发布失败]

转载 作者:数据小太阳 更新时间:2023-10-29 08:12:14 25 4
gpt4 key购买 nike

您好,我在部署应用程序时遇到问题。我无法部署我的应用程序,因为我的 git 发布有问题

DEBUG[53fd915c] Finished in 2.573 seconds with exit status 0 (successful).
INFO[545c6125] Running /usr/bin/env mkdir -pv ~/deploy/shared ~/deploy/releases on
DEBUG[545c6125] Command: ( RVM_BIN_PATH=~/.rvm/bin /usr/bin/env mkdir -pv ~/deploy/shared ~/deploy/releases )
INFO[545c6125] Finished in 0.042 seconds with exit status 0 (successful).
INFO[021eadb4] Running /usr/bin/env mkdir -pv ~/deploy/shared/bin ~/deploy/shared/log ~/deploy/shared/tmp/pids ~/deploy/shared/tmp/cache ~/deploy/shared/tmp/sockets ~/deploy/shared/vendor/bundle ~/deploy/shared/public/system on DEBUG[021eadb4] Command: ( RVM_BIN_PATH=~/.rvm/bin /usr/bin/env mkdir -pv ~/deploy/shared/bin ~/deploy/shared/log ~/deploy/shared/tmp/pids ~/deploy/shared/tmp/cache ~/deploy/shared/tmp/sockets ~/deploy/shared/vendor/bundle ~/deploy/shared/public/system )
INFO[021eadb4] Finished in 0.040 seconds with exit status 0 (successful).
INFO[c4cc4af5] Running /usr/bin/env mkdir -pv ~/deploy/shared/config on DEBUG[c4cc4af5] Command: ( RVM_BIN_PATH=~/.rvm/bin /usr/bin/env mkdir -pv ~/deploy/shared/config )
INFO[c4cc4af5] Finished in 0.038 seconds with exit status 0 (successful).
DEBUG[c231d0c7] Running /usr/bin/env [ -f ~/deploy/shared/config/database.yml ] on DEBUG[c231d0c7] Command: [ -f ~/deploy/shared/config/database.yml ]
DEBUG[c231d0c7] Finished in 0.032 seconds with exit status 0 (successful).
DEBUG[b42c9ef2] Running /usr/bin/env [ -f ~/deploy/current/REVISION ] on DEBUG[b42c9ef2] Command: [ -f ~/deploy/current/REVISION ]
DEBUG[b42c9ef2] Finished in 0.031 seconds with exit status 1 (failed).
DEBUG[9f6e7e95] Running /usr/bin/env [ -f ~/deploy/repo/HEAD ] on
DEBUG[9f6e7e95] Command: [ -f ~/deploy/repo/HEAD ]
DEBUG[9f6e7e95] Finished in 0.031 seconds with exit status 0 (successful).
INFOThe repository mirror is at ~/deploy/repo
DEBUG[2c4a5ab1] Running /usr/bin/env if test ! -d ~/deploy/repo; then echo "Directory does not exist '~/deploy/repo'" 1>&2; false; fi on
DEBUG[2c4a5ab1] Command: if test ! -d ~/deploy/repo; then echo "Directory does not exist '~/deploy/repo'" 1>&2; false; fi
DEBUG[2c4a5ab1] Finished in 0.029 seconds with exit status 0 (successful).
INFO[ba7cef28] Running /usr/bin/env git remote update on
DEBUG[ba7cef28] Command: cd ~/deploy/repo && ( RVM_BIN_PATH=~/.rvm/bin GIT_ASKPASS=/bin/echo GIT_SSH=/tmp/aligator/git-ssh.sh /usr/bin/env git remote update )
INFO[ba7cef28] Finished in 0.038 seconds with exit status 0 (successful).
DEBUG[f0098e08] Running /usr/bin/env if test ! -d ~/deploy/repo; then echo "Directory does not exist '~/deploy/repo'" 1>&2; false; fi on
DEBUG[f0098e08] Command: if test ! -d ~/deploy/repo; then echo "Directory does not exist '~/deploy/repo'" 1>&2; false; fi
DEBUG[f0098e08] Finished in 0.031 seconds with exit status 0 (successful).
INFO[4b4fe200] Running /usr/bin/env mkdir -p ~/deploy/releases/20140805094710 on
DEBUG[4b4fe200] Command: cd ~/deploy/repo && ( RVM_BIN_PATH=~/.rvm/bin GIT_ASKPASS=/bin/echo GIT_SSH=/tmp/aligator/git-ssh.sh /usr/bin/env mkdir -p ~/deploy/releases/20140805094710 )
INFO[4b4fe200] Finished in 0.038 seconds with exit status 0 (successful).
INFO[1bd3716b] Running /usr/bin/env git archive master | tar -x -C ~/deploy/releases/20140805094710 on
DEBUG[1bd3716b] Command: cd ~/deploy/repo && ( RVM_BIN_PATH=~/.rvm/bin GIT_ASKPASS=/bin/echo GIT_SSH=/tmp/aligator/git-ssh.sh /usr/bin/env git archive master | tar -x -C ~/deploy/releases/20140805094710 )
DEBUG[1bd3716b] fatal: Not a valid object name
DEBUG[1bd3716b] tar: This does not look like a tar archive
DEBUG[1bd3716b] tar: Exiting with failure status due to previous errors
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing on host : git exit status: 2
git stdout: Nothing written
git stderr: Nothing written

有人知道为什么会这样吗?也许这是 rvm 或其他问题,我花了很多时间但没有成功

最佳答案

  • 我也遇到了和你一样的问题(但我的案例是部署到特定分支),有人在这里建议 Capistrano error tar: This does not look like a tar archive .但是他给了 2 个不适合我情况的选项,我不想删除我当前的 repo。
  • 经过 1 小时的变通,我有了一个解决方案:
  • 例如:

    • 之前:(部署/生产.rb)

      set :branch, ENV["BRANCH_NAME"] || "master"
      (I stay at master branch then run command)
      BRANCH_NAME=another_branch_name cap production deploy

      然后我得到一个类似上面的错误

    • 之后:(deploy/production.rb)

      set :branch, `git rev-parse --abbrev-ref HEAD`.chomp
      (I stay at another_branch_name then run command)
      cap production deploy

      错误已修复。

关于ruby-on-rails - 使用 rvm 和 git 部署 Capistrano [git 发布失败],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25135827/

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