お世話になっております。
現在、アプリの自動デプロイ を実装しています。
下記を参考にし、bundle exec cap production deployを実行するとエラーが出ます。
https://qiita.com/gyu_outputs/items/b123ef229842d857ff39#cant-connect-to-local-mysql-server-through-socket-tmpmysqlsock-13
エラー内容
$ 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 #<Thread:0x000000000302fb90@/home/ec2-user/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/sshkit-1.21.1/lib/sshkit/runners/parallel.rb:10 run> terminated with exception (report_on_exception is true): Traceback (most recent call last): 17: from /home/ec2-user/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/sshkit-1.21.1/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute' 16: from /home/ec2-user/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/sshkit-1.21.1/lib/sshkit/backends/abstract.rb:31:in `run' 15: from /home/ec2-user/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/sshkit-1.21.1/lib/sshkit/backends/abstract.rb:31:in `instance_exec' 14: from /home/ec2-user/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/capistrano-rbenv-2.2.0/lib/capistrano/tasks/rbenv.rake:10:in `block (3 levels) in <top (required)>' 13: from /home/ec2-user/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/sshkit-1.21.1/lib/sshkit/backends/abstract.rb:61:in `test' 12: from /home/ec2-user/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/sshkit-1.21.1/lib/sshkit/backends/abstract.rb:148:in `create_command_and_execute' 11: from /home/ec2-user/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/sshkit-1.21.1/lib/sshkit/backends/abstract.rb:148:in `tap' 10: from /home/ec2-user/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/sshkit-1.21.1/lib/sshkit/backends/abstract.rb:148:in `block in create_command_and_execute' 9: from /home/ec2-user/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/sshkit-1.21.1/lib/sshkit/backends/netssh.rb:130:in `execute_command' 8: from /home/ec2-user/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/sshkit-1.21.1/lib/sshkit/backends/netssh.rb:177:in `with_ssh' 7: from /home/ec2-user/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/sshkit-1.21.1/lib/sshkit/backends/connection_pool.rb:63:in `with' 6: from /home/ec2-user/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/sshkit-1.21.1/lib/sshkit/backends/connection_pool.rb:63:in `call' 5: from /home/ec2-user/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/net-ssh-6.1.0/lib/net/ssh.rb:251:in `start' 4: from /home/ec2-user/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/net-ssh-6.1.0/lib/net/ssh.rb:251:in `new' 3: from /home/ec2-user/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/net-ssh-6.1.0/lib/net/ssh/transport/session.rb:73:in `initialize' 2: from /home/ec2-user/.rbenv/versions/2.6.3/lib/ruby/2.6.0/socket.rb:631:in `tcp' 1: from /home/ec2-user/.rbenv/versions/2.6.3/lib/ruby/2.6.0/socket.rb:227:in `foreach' /home/ec2-user/.rbenv/versions/2.6.3/lib/ruby/2.6.0/socket.rb:227:in `getaddrinfo': getaddrinfo: Name or service not known (SocketError) 1: from /home/ec2-user/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/sshkit-1.21.1/lib/sshkit/runners/parallel.rb:11:in `block (2 levels) in execute' /home/ec2-user/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/sshkit-1.21.1/lib/sshkit/runners/parallel.rb:15:in `rescue in block (2 levels) in execute': Exception while executing as ec2-user@18.52.197.1.109: getaddrinfo: Name or service not known (SSHKit::Runner::ExecuteError) (Backtrace restricted to imported tasks) cap aborted! SSHKit::Runner::ExecuteError: Exception while executing as ec2-user@18.52.197.1.109: getaddrinfo: Name or service not known Caused by: SocketError: getaddrinfo: Name or service not known Tasks: TOP => rbenv:validate (See full trace by running task with --trace)
Capistrianoを実装する際に作るファイル自体に凡ミスはないと見ています。
今回のエラーは、他の箇所からのエラーでしょうか?
お力願いたいです。
よろしくお願い致します。
補足です。
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 #<Thread:0x00007fd5fb312800@/Library/Ruby/Gems/2.6.0/gems/sshkit-1.21.1/lib/sshkit/runners/parallel.rb:10 run> terminated with exception (report_on_exception is true): Traceback (most recent call last): 17: from /Library/Ruby/Gems/2.6.0/gems/sshkit-1.21.1/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute' 16: from /Library/Ruby/Gems/2.6.0/gems/sshkit-1.21.1/lib/sshkit/backends/abstract.rb:31:in `run' 15: from /Library/Ruby/Gems/2.6.0/gems/sshkit-1.21.1/lib/sshkit/backends/abstract.rb:31:in `instance_exec' 14: from /Library/Ruby/Gems/2.6.0/gems/capistrano-rbenv-2.2.0/lib/capistrano/tasks/rbenv.rake:10:in `block (3 levels) in <top (required)>' 13: from /Library/Ruby/Gems/2.6.0/gems/sshkit-1.21.1/lib/sshkit/backends/abstract.rb:61:in `test' 12: from /Library/Ruby/Gems/2.6.0/gems/sshkit-1.21.1/lib/sshkit/backends/abstract.rb:148:in `create_command_and_execute' 11: from /Library/Ruby/Gems/2.6.0/gems/sshkit-1.21.1/lib/sshkit/backends/abstract.rb:148:in `tap' 10: from /Library/Ruby/Gems/2.6.0/gems/sshkit-1.21.1/lib/sshkit/backends/abstract.rb:148:in `block in create_command_and_execute' 9: from /Library/Ruby/Gems/2.6.0/gems/sshkit-1.21.1/lib/sshkit/backends/netssh.rb:130:in `execute_command' 8: from /Library/Ruby/Gems/2.6.0/gems/sshkit-1.21.1/lib/sshkit/backends/netssh.rb:177:in `with_ssh' 7: from /Library/Ruby/Gems/2.6.0/gems/sshkit-1.21.1/lib/sshkit/backends/connection_pool.rb:63:in `with' 6: from /Library/Ruby/Gems/2.6.0/gems/sshkit-1.21.1/lib/sshkit/backends/connection_pool.rb:63:in `call' 5: from /Library/Ruby/Gems/2.6.0/gems/net-ssh-6.1.0/lib/net/ssh.rb:251:in `start' 4: from /Library/Ruby/Gems/2.6.0/gems/net-ssh-6.1.0/lib/net/ssh.rb:251:in `new' 3: from /Library/Ruby/Gems/2.6.0/gems/net-ssh-6.1.0/lib/net/ssh/transport/session.rb:73:in `initialize' 2: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/socket.rb:631:in `tcp' 1: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/socket.rb:227:in `foreach' /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/socket.rb:227:in `getaddrinfo': getaddrinfo: nodename nor servname provided, or not known (SocketError) 1: from /Library/Ruby/Gems/2.6.0/gems/sshkit-1.21.1/lib/sshkit/runners/parallel.rb:11:in `block (2 levels) in execute' /Library/Ruby/Gems/2.6.0/gems/sshkit-1.21.1/lib/sshkit/runners/parallel.rb:15:in `rescue in block (2 levels) in execute': Exception while executing as ec2-user@18.52.197.1.109: getaddrinfo: nodename nor servname provided, or not known (SSHKit::Runner::ExecuteError) (Backtrace restricted to imported tasks) cap aborted! SSHKit::Runner::ExecuteError: Exception while executing as ec2-user@18.52.197.1.109: getaddrinfo: nodename nor servname provided, or not known Caused by: SocketError: getaddrinfo: nodename nor servname provided, or not known Tasks: TOP => rbenv:validate (See full trace by running task with --trace)
あなたの回答
tips
プレビュー