デプロイ作業をしてる際、bundle exec rails assets:precompile RAILS_ENV=productionを使ったときに下記エラー画面が出ました。
rails aborted!
LoadError: Error loading the 'mysql2' Active Record adapter. Missing a gem it depends on? mysql2 is not part of the bundle. Add it to your Gemfile.
/home/ec2-user/Instagram_app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/mysql2_adapter.rb:6:in <top (required)>' /home/ec2-user/Instagram_app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in
require'
/home/ec2-user/Instagram_app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in block in require_with_bootsnap_lfi' /home/ec2-user/Instagram_app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in
register'
/home/ec2-user/Instagram_app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in require_with_bootsnap_lfi' /home/ec2-user/Instagram_app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in
require'
/home/ec2-user/Instagram_app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:291:in block in require' /home/ec2-user/Instagram_app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:257:in
load_dependency'
/home/ec2-user/Instagram_app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:291:in require' /home/ec2-user/Instagram_app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/connection_specification.rb:191:in
spec'
/home/ec2-user/Instagram_app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:975:in establish_connection' /home/ec2-user/Instagram_app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4.3/lib/active_record/connection_handling.rb:60:in
establish_connection'
/home/ec2-user/Instagram_app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4.3/lib/active_record/railtie.rb:136:in block (2 levels) in <class:Railtie>' /home/ec2-user/Instagram_app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.3/lib/active_support/lazy_load_hooks.rb:71:in
instance_eval'
/home/ec2-user/Instagram_app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.3/lib/active_support/lazy_load_hooks.rb:71:in block in execute_hook' /home/ec2-user/Instagram_app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.3/lib/active_support/lazy_load_hooks.rb:62:in
with_execution_control'
/home/ec2-user/Instagram_app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.3/lib/active_support/lazy_load_hooks.rb:67:in execute_hook' /home/ec2-user/Instagram_app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.3/lib/active_support/lazy_load_hooks.rb:52:in
block in run_load_hooks'
/home/ec2-user/Instagram_app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.3/lib/active_support/lazy_load_hooks.rb:51:in each' /home/ec2-user/Instagram_app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.3/lib/active_support/lazy_load_hooks.rb:51:in
run_load_hooks'
/home/ec2-user/Instagram_app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4.3/lib/active_record/base.rb:328:in <module:ActiveRecord>' /home/ec2-user/Instagram_app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.4.3/lib/active_record/base.rb:27:in
<top (required)>'
/home/ec2-user/Instagram_app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in require' /home/ec2-user/Instagram_app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in
block in require_with_bootsnap_lfi'
/home/ec2-user/Instagram_app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in register' /home/ec2-user/Instagram_app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in
require_with_bootsnap_lfi'
/home/ec2-user/Instagram_app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in require' /home/ec2-user/Instagram_app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:291:in
block in require'
/home/ec2-user/Instagram_app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:257:in load_dependency' /home/ec2-user/Instagram_app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:291:in
require'
/home/ec2-user/Instagram_app/app/models/application_record.rb:1:in <top (required)>' /home/ec2-user/Instagram_app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in
require'
/home/ec2-user/Instagram_app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in block in require_with_bootsnap_lfi' /home/ec2-user/Instagram_app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in
register'
/home/ec2-user/Instagram_app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in require_with_bootsnap_lfi' /home/ec2-user/Instagram_app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in
require'
/home/ec2-user/Instagram_app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:291:in block in require' /home/ec2-user/Instagram_app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:257:in
load_dependency'
/home/ec2-user/Instagram_app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:291:in require' /home/ec2-user/Instagram_app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:378:in
block in require_or_load'
/home/ec2-user/Instagram_app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:37:in block in load_interlock' /home/ec2-user/Instagram_app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies/interlock.rb:14:in
block in loading'
/home/ec2-user/Instagram_app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.3/lib/active_support/concurrency/share_lock.rb:151:in exclusive' /home/ec2-user/Instagram_app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies/interlock.rb:13:in
loading'
/home/ec2-user/Instagram_app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:37:in load_interlock' /home/ec2-user/Instagram_app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:356:in
require_or_load'
/home/ec2-user/Instagram_app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/active_support.rb:49:in block in require_or_load' /home/ec2-user/Instagram_app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/active_support.rb:17:in
allow_bootsnap_retry'
/home/ec2-user/Instagram_app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/active_support.rb:48:in require_or_load' /home/ec2-user/Instagram_app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:510:in
load_missing_constant'
/home/ec2-user/Instagram_app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/active_support.rb:61:in block in load_missing_constant' /home/ec2-user/Instagram_app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/active_support.rb:17:in
allow_bootsnap_retry'
/home/ec2-user/Instagram_app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/active_support.rb:60:in load_missing_constant' /home/ec2-user/Instagram_app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:195:in
const_missing'
/home/ec2-user/Instagram_app/app/models/user.rb:1:in <top (required)>' /home/ec2-user/Instagram_app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in
require'
/home/ec2-user/Instagram_app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in
Tasks: TOP => environment
(See full trace by running task with --trace)
エラー内容が長すぎて、記載できるところまで記載してます。
検索しても分からずご教授頂ければと思います。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2020/08/19 05:21