Herokuでデプロイ済のRailsアプリをAWSのEC2環境に移行しています。
AWSではDBにMysqlを使用しています。DBの中身はリセットしてしまって問題ないです。
以下エラー文と修正文です。
terminal
1$ bundle exec unicorn_rails -c config/unicorn.rb -E production -D 2bundler: failed to load command: unicorn_rails (/home/ec2-user/.rbenv/versions/2.5.1/bin/unicorn_rails) 3LoadError: Error loading the 'postgresql' Active Record adapter. Missing a gem it depends on? pg is not part of the bundle. Add it to your Gemfile.
Gemfile
1# group :production do 2# gem 'pg' 3# end
databaseyml
1#production: 2#半角スペース2個分の空白を開ける 3 #<<: *default 4 #adapter: postgresql 5 #encoding: unicode 6 #pool: 5 7 8production: 9 <<: *default 10 database: blog_production 11 username: root 12 password: <%= ENV['DATABASE_PASSWORD'] %> 13 socket: /var/lib/mysql/mysql.sock 14
上のようにGemfileのpgをコメントアウト、database.ymlに変更を加えています。
宜しくお願いします。
あなたの回答
tips
プレビュー