前提・実現したいこと
bundle exec cap production deployで自動デプロイをAWSのEC2サーバーから行った際、
以下エラーが発生しデプロイできません。
発生している問題・エラーメッセージ
[Deprecation Notice] Future versions of Capistrano will not load the Git SCM plugin by default. To silence this deprecation warning, add the following to your Capfile after `require "capistrano/deploy"`: require "capistrano/scm/git" install_plugin Capistrano::SCM::Git 00:00 git:wrapper 01 mkdir -p /tmp ✔ 01 ec2-user@18.180.70.170 0.120s Uploading /tmp/git-ssh-social-engineer-tree-production-kimiakisakao.sh 100.0% 02 chmod 700 /tmp/git-ssh-social-engineer-tree-production-kimiakisakao.sh ✔ 02 ec2-user@18.180.70.170 0.116s 00:00 git:check 01 git ls-remote git@github.com:sakaokimiaki33/social-engineer-tree .git HEAD 01 aa68728ff1acb4fd2b0bb3633409f6dccc31605d HEAD 01 aa68728ff1acb4fd2b0bb3633409f6dccc31605d refs/heads/master 01 9602c162b82b60ffced82c1903684381292ee4a9 refs/pull/1/head 01 bash: 行 1: .git: コマンドが見つかりません #<Thread:0x00007fa8e1499698@/Users/kimiakisakao/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sshkit-1.21.0/lib/sshkit/runners/parallel.rb:10 run> terminated with exception (report_on_exception is true): Traceback (most recent call last): 1: from /Users/kimiakisakao/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sshkit-1.21.0/lib/sshkit/runners/parallel.rb:11:in `block (2 levels) in execute' /Users/kimiakisakao/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sshkit-1.21.0/lib/sshkit/runners/parallel.rb:15:in `rescue in block (2 levels) in execute': Exception while executing as ec2-user@18.180.70.170: git exit status: 127 (SSHKit::Runner::ExecuteError) git stdout: aa68728ff1acb4fd2b0bb3633409f6dccc31605d HEAD aa68728ff1acb4fd2b0bb3633409f6dccc31605d refs/heads/master 9602c162b82b60ffced82c1903684381292ee4a9 refs/pull/1/head git stderr: bash: 行 1: .git: コマンドが見つかりません (Backtrace restricted to imported tasks) cap aborted! SSHKit::Runner::ExecuteError: Exception while executing as ec2-user@18.180.70.170: git exit status: 127 git stdout: aa68728ff1acb4fd2b0bb3633409f6dccc31605d HEAD aa68728ff1acb4fd2b0bb3633409f6dccc31605d refs/heads/master 9602c162b82b60ffced82c1903684381292ee4a9 refs/pull/1/head git stderr: bash: 行 1: .git: コマンドが見つかりません Caused by: SSHKit::Command::Failed: git exit status: 127 git stdout: aa68728ff1acb4fd2b0bb3633409f6dccc31605d HEAD aa68728ff1acb4fd2b0bb3633409f6dccc31605d refs/heads/master 9602c162b82b60ffced82c1903684381292ee4a9 refs/pull/1/head git stderr: bash: 行 1: .git: コマンドが見つかりません Tasks: TOP => deploy:check => git:check (See full trace by running task with --trace) The deploy has failed with an error: Exception while executing as ec2-user@18.180.70.170: git exit status: 127 git stdout: aa68728ff1acb4fd2b0bb3633409f6dccc31605d HEAD aa68728ff1acb4fd2b0bb3633409f6dccc31605d refs/heads/master 9602c162b82b60ffced82c1903684381292ee4a9 refs/pull/1/head git stderr: bash: 行 1: .git: コマンドが見つかりません ** DEPLOY FAILED ** Refer to log/capistrano.log for details. Here are the last 20 lines: INFO --------------------------------------------------------------------------- DEBUG [f8473ce7] Running [ -d $HOME/.rbenv/versions/2.5.1 ] as ec2-user@18.180.70.170 DEBUG [f8473ce7] Command: [ -d $HOME/.rbenv/versions/2.5.1 ] DEBUG [f8473ce7] Finished in 0.374 seconds with exit status 0 (successful). INFO [442ae972] Running /usr/bin/env mkdir -p /tmp as ec2-user@18.180.70.170 DEBUG [442ae972] Command: ( export RBENV_ROOT="$HOME/.rbenv" RBENV_VERSION="2.5.1" ; /usr/bin/env mkdir -p /tmp ) INFO [442ae972] Finished in 0.120 seconds with exit status 0 (successful). DEBUG Uploading /tmp/git-ssh-social-engineer-tree-production-kimiakisakao.sh 0.0% INFO Uploading /tmp/git-ssh-social-engineer-tree-production-kimiakisakao.sh 100.0% INFO [161e138f] Running /usr/bin/env chmod 700 /tmp/git-ssh-social-engineer-tree-production-kimiakisakao.sh as ec2-user@18.180.70.170 DEBUG [161e138f] Command: ( export RBENV_ROOT="$HOME/.rbenv" RBENV_VERSION="2.5.1" ; /usr/bin/env chmod 700 /tmp/git-ssh-social-engineer-tree-production-kimiakisakao.sh ) INFO [161e138f] Finished in 0.116 seconds with exit status 0 (successful). INFO [f3c23322] Running /usr/bin/env git ls-remote git@github.com:sakaokimiaki33/social-engineer-tree .git HEAD as ec2-user@18.180.70.170 DEBUG [f3c23322] Command: ( export RBENV_ROOT="$HOME/.rbenv" RBENV_VERSION="2.5.1" GIT_ASKPASS="/bin/echo" GIT_SSH="/tmp/git-ssh-social-engineer-tree-production-kimiakisakao.sh" ; /usr/bin/env git ls-remote git@github.com:sakaokimiaki33/social-engineer-tree .git HEAD ) DEBUG [f3c23322] aa68728ff1acb4fd2b0bb3633409f6dccc31605d HEAD aa68728ff1acb4fd2b0bb3633409f6dccc31605d refs/heads/master 9602c162b82b60ffced82c1903684381292ee4a9 refs/pull/1/head DEBUG [f3c23322] bash: 行 1: .git: コマンドが見つかりません mb:social-engineer-tree kimiakisakao$ bundle exec cap production deploy [Deprecation Notice] Future versions of Capistrano will not load the Git SCM plugin by default. To silence this deprecation warning, add the following to your Capfile after `require "capistrano/deploy"`: require "capistrano/scm/git" install_plugin Capistrano::SCM::Git 00:00 git:wrapper 01 mkdir -p /tmp ✔ 01 ec2-user@18.180.70.170 0.107s Uploading /tmp/git-ssh-social-engineer-tree-production-kimiakisakao.sh 100.0% 02 chmod 700 /tmp/git-ssh-social-engineer-tree-production-kimiakisakao.sh ✔ 02 ec2-user@18.180.70.170 0.113s 00:00 git:check 01 git ls-remote git@github.com:sakaokimiaki33/social-engineer-tree .git HEAD 01 Warning: Permanently added the RSA host key for IP address '13.114.40.48' to the list of known hosts. 01 aa68728ff1acb4fd2b0bb3633409f6dccc31605d HEAD 01 aa68728ff1acb4fd2b0bb3633409f6dccc31605d refs/heads/master 01 9602c162b82b60ffced82c1903684381292ee4a9 refs/pull/1/head 01 bash: 行 1: .git: コマンドが見つかりません #<Thread:0x00007faffb84f140@/Users/kimiakisakao/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sshkit-1.21.0/lib/sshkit/runners/parallel.rb:10 run> terminated with exception (report_on_exception is true): Traceback (most recent call last): 1: from /Users/kimiakisakao/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sshkit-1.21.0/lib/sshkit/runners/parallel.rb:11:in `block (2 levels) in execute' /Users/kimiakisakao/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sshkit-1.21.0/lib/sshkit/runners/parallel.rb:15:in `rescue in block (2 levels) in execute': Exception while executing as ec2-user@18.180.70.170: git exit status: 127 (SSHKit::Runner::ExecuteError) git stdout: aa68728ff1acb4fd2b0bb3633409f6dccc31605d HEAD aa68728ff1acb4fd2b0bb3633409f6dccc31605d refs/heads/master 9602c162b82b60ffced82c1903684381292ee4a9 refs/pull/1/head git stderr: Warning: Permanently added the RSA host key for IP address '13.114.40.48' to the list of known hosts. bash: 行 1: .git: コマンドが見つかりません (Backtrace restricted to imported tasks) cap aborted! SSHKit::Runner::ExecuteError: Exception while executing as ec2-user@18.180.70.170: git exit status: 127 git stdout: aa68728ff1acb4fd2b0bb3633409f6dccc31605d HEAD aa68728ff1acb4fd2b0bb3633409f6dccc31605d refs/heads/master 9602c162b82b60ffced82c1903684381292ee4a9 refs/pull/1/head git stderr: Warning: Permanently added the RSA host key for IP address '13.114.40.48' to the list of known hosts. bash: 行 1: .git: コマンドが見つかりません Caused by: SSHKit::Command::Failed: git exit status: 127 git stdout: aa68728ff1acb4fd2b0bb3633409f6dccc31605d HEAD aa68728ff1acb4fd2b0bb3633409f6dccc31605d refs/heads/master 9602c162b82b60ffced82c1903684381292ee4a9 refs/pull/1/head git stderr: Warning: Permanently added the RSA host key for IP address '13.114.40.48' to the list of known hosts. bash: 行 1: .git: コマンドが見つかりません Tasks: TOP => deploy:check => git:check (See full trace by running task with --trace) The deploy has failed with an error: Exception while executing as ec2-user@18.180.70.170: git exit status: 127 git stdout: aa68728ff1acb4fd2b0bb3633409f6dccc31605d HEAD aa68728ff1acb4fd2b0bb3633409f6dccc31605d refs/heads/master 9602c162b82b60ffced82c1903684381292ee4a9 refs/pull/1/head git stderr: Warning: Permanently added the RSA host key for IP address '13.114.40.48' to the list of known hosts. bash: 行 1: .git: コマンドが見つかりません ** DEPLOY FAILED ** Refer to log/capistrano.log for details. Here are the last 20 lines: DEBUG [f6821bed] Running [ -d $HOME/.rbenv/versions/2.5.1 ] as ec2-user@18.180.70.170 DEBUG [f6821bed] Command: [ -d $HOME/.rbenv/versions/2.5.1 ] DEBUG [f6821bed] Finished in 0.366 seconds with exit status 0 (successful). INFO [d3d7586e] Running /usr/bin/env mkdir -p /tmp as ec2-user@18.180.70.170 DEBUG [d3d7586e] Command: ( export RBENV_ROOT="$HOME/.rbenv" RBENV_VERSION="2.5.1" ; /usr/bin/env mkdir -p /tmp ) INFO [d3d7586e] Finished in 0.107 seconds with exit status 0 (successful). DEBUG Uploading /tmp/git-ssh-social-engineer-tree-production-kimiakisakao.sh 0.0% INFO Uploading /tmp/git-ssh-social-engineer-tree-production-kimiakisakao.sh 100.0% INFO [42873045] Running /usr/bin/env chmod 700 /tmp/git-ssh-social-engineer-tree-production-kimiakisakao.sh as ec2-user@18.180.70.170
試したこと
stderr_pathのシェアが読み込まれていない?
再度bundle exec cap production deployを入力して実行するも同じエラーが表示される
補足情報(FW/ツールのバージョンなど)
ruby 2.5.1
Rails 5.2.4.2
capistrano 3.14.0
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。