ruby on rails でアプリを作成し、
AWS、EC2を使ってデプロイしているところです。
macで作成してます。
デプロイ編②)世界一丁寧なAWS解説。EC2を利用して、RailsアプリをAWSにあげるまで
を参考に進めています。
unicornを起動したく、
$ bundle exec unicorn_rails -c /var/www/rails/アプリ/config/unicorn.conf.rb -D -E production
をすると
master failed to start, check stderr log for details
と出てしまい、エラーログを確認すると、
I, [2020-02-03T15:08:18.932502 #956] INFO -- : Refreshing Gem list I, [2020-02-03T15:08:20.139365 #956] INFO -- : unlinking existing socket=/var/www/rails/アプリ/tmp/sockets/.unicorn.sock I, [2020-02-03T15:08:20.139549 #956] INFO -- : listening on addr=/var/www/rails/アプリ/tmp/sockets/.unicorn.sock fd=6 E, [2020-02-03T15:08:20.141225 #956] ERROR -- : Access denied for user 'userman'@'localhost' (using password: YES) (Mysql2::Error::ConnectionError) /home/userman/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/mysql2-0.5.2/lib/mysql2/client.rb:90:in `connect' /home/userman/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/mysql2-0.5.2/lib/mysql2/client.rb:90:in `initialize' /home/userman/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/mysql2_adapter.rb:22:in `new' /home/userman/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/mysql2_adapter.rb:22:in `mysql2_connection' /home/userman/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:811:in `new_connection' /home/userman/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:855:in `checkout_new_connection' /home/userman/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:834:in `try_to_checkout_new_connection' /home/userman/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:795:in `acquire_connection' /home/userman/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:523:in `checkout' /home/userman/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:382:in `connection' /home/userman/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:1014:in `retrieve_connection' /home/userman/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/activerecord-5.2.3/lib/active_record/connection_handling.rb:118:in `retrieve_connection' /home/userman/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/activerecord-5.2.3/lib/active_record/connection_handling.rb:90:in `connection' /var/www/rails/アプリ/config/unicorn.conf.rb:20:in `block in reload' /home/userman/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/unicorn-5.5.3/lib/unicorn/http_server.rb:542:in `spawn_missing_workers' /home/userman/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/unicorn-5.5.3/lib/unicorn/http_server.rb:144:in `start' /home/userman/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/unicorn-5.5.3/bin/unicorn_rails:209:in `<top (required)>' /home/userman/.rbenv/versions/2.6.5/bin/unicorn_rails:23:in `load' /home/userman/.rbenv/versions/2.6.5/bin/unicorn_rails:23:in `<top (required)>' /home/userman/.rbenv/versions/2.6.5/lib/ruby/2.6.0/bundler/cli/exec.rb:74:in `load' /home/userman/.rbenv/versions/2.6.5/lib/ruby/2.6.0/bundler/cli/exec.rb:74:in `kernel_load' /home/userman/.rbenv/versions/2.6.5/lib/ruby/2.6.0/bundler/cli/exec.rb:28:in `run' /home/userman/.rbenv/versions/2.6.5/lib/ruby/2.6.0/bundler/cli.rb:463:in `exec' /home/userman/.rbenv/versions/2.6.5/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run' /home/userman/.rbenv/versions/2.6.5/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command' /home/userman/.rbenv/versions/2.6.5/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor.rb:387:in `dispatch' /home/userman/.rbenv/versions/2.6.5/lib/ruby/2.6.0/bundler/cli.rb:27:in `dispatch' /home/userman/.rbenv/versions/2.6.5/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor/base.rb:466:in `start' /home/userman/.rbenv/versions/2.6.5/lib/ruby/2.6.0/bundler/cli.rb:18:in `start' /home/userman/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/bundler-1.17.2/exe/bundle:30:in `block in <top (required)>' /home/userman/.rbenv/versions/2.6.5/lib/ruby/2.6.0/bundler/friendly_errors.rb:124:in `with_friendly_errors' /home/userman/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/bundler-1.17.2/exe/bundle:22:in `<top (required)>' /home/userman/.rbenv/versions/2.6.5/bin/bundle:23:in `load' /home/userman/.rbenv/versions/2.6.5/bin/bundle:23:in `<main>'
ログをみると、mysqlのエラーだと思い
初心者がAWS(EC2)にアプリをデプロイする際に対峙したエラーとその対応
を参考に解決しようと思っているのですが、
どのファイルをさわればいいかわからず困っています。
どなたか教えていただけると幸いです
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。