###前提・実現したいこと
Ruby on RailとCapistranoを使い、AWSサーバーにアプリケーションを載せたいです。
###発生している問題・エラーメッセージ
ローカルからサーバー側にデプロイ(bundle exec cap deploy production)する際に以下のようなエラーが出てきてしまいます。
エラーメッセージ
miyazawa$ bundle exec cap deploy production (in /Users/miyazawa/Desktop/projects/rootcrew/thirds) /Users/miyazawa/Desktop/projects/rootcrew/thirds/vendor/bundle/gems/sshkit-1.14.0/lib/sshkit/backends/connection_pool.rb:59:in `call': Passing nil, or [nil] to Net::SSH.start is deprecated for keys: user (Backtrace restricted to imported tasks) cap aborted! SSHKit::Runner::ExecuteError: Exception while executing as miyako@54.238.138.153: Authentication failed for user miyako@54.238.138.153 Net::SSH::AuthenticationFailed: Authentication failed for user miyako@54.238.138.153 Tasks: TOP => rbenv:validate (See full trace by running task with --trace) miyazawakoujinoMacBook-Air:deploy miyazawa$ scp ~/.ssh/id_rsa.pub 54.238.138.153:/home/miyako/.ssh Permission denied (publickey). lost connection ###該当のソースコード ```config/deploy/production.rb
server '54.238.138.153', user: 'miyako', roles: %w{app}
#set :ssh_options, port: '22', keys: '/.ssh/aws_git_rsa'/downloads/my-key.pem) }
#set :ssh_options, {port: '22', forward_agent: true, user: fetch(:user), keys: %w(
set :ssh_options, {port: '22', forward_agent: true, user: fetch(:user), keys: [File.expand_path('~/.ssh/id_rsa')] }
```config/deploy.rb config/deploy.rb set :application, "thirds" set :repo_url, "git@example.com:me/thirds.git" # Default branch is :master # ask :branch, `git rev-parse --abbrev-ref HEAD`.chomp # Default deploy_to directory is /var/www/third set :deploy_to, "/var/www/third" # Default value for :format is :airbrussh. # set :format, :airbrussh # You can configure the Airbrussh format using :format_options. # These are the defaults. # set :format_options, command_output: true, log_file: "log/capistrano.log", color: :auto, truncate: :auto # Default value for :pty is false # set :pty, true # Default value for :linked_files is [] #append :linked_files, "config/database.yml", "config/secrets.yml" # シンボリックリンクをはるファイル。今回はgemのconfigを使用して、production.yml>を共通化。 set :linked_files, fetch(:linked_files, []).push('config/settings/production.yml') # Default value for linked_dirs is [] #append :linked_dirs, "log", "tmp/pids", "tmp/cache", "tmp/sockets", "public/system" # シンボリックリンクをはるフォルダ。 set :linked_dirs, fetch(:linked_dirs, []).push('log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'vendor/bundle', 'public/system')
###試したこと
課題に対してアプローチしたことを記載してください
###補足情報(言語/FW/ツール等のバージョンなど)
より詳細な情報
あなたの回答
tips
プレビュー