前提・実現したいこと
Ruby on Railsでwebシステムを作っています。
herokuでデプロイし、railsコンソールを確認すると以下のエラーメッセージが発生しました。
発生している問題・エラーメッセージ
Traceback (most recent call last): 53: from /app/bin/rails:9:in `<main>' 52: from /app/bin/rails:9:in `require' 51: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.1.7/lib/rails/commands.rb:16:in `<top (required)>' 50: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.1.7/lib/rails/command.rb:44:in `invoke' 49: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.1.7/lib/rails/command/base.rb:63:in `perform' 48: from /app/vendor/bundle/ruby/2.6.0/gems/thor-1.0.1/lib/thor.rb:392:in `dispatch' 47: from /app/vendor/bundle/ruby/2.6.0/gems/thor-1.0.1/lib/thor/invocation.rb:127:in `invoke_command' 46: from /app/vendor/bundle/ruby/2.6.0/gems/thor-1.0.1/lib/thor/command.rb:27:in `run' 45: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.1.7/lib/rails/commands/console/console_command.rb:96:in `perform' 44: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.1.7/lib/rails/command/actions.rb:16:in `require_application_and_environment!' 43: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.1.7/lib/rails/application.rb:329:in `require_environment!' 42: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.1.7/lib/rails/application.rb:329:in `require' 41: from /app/config/environment.rb:5:in `<top (required)>' 40: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.1.7/lib/rails/application.rb:353:in `initialize!' 39: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.1.7/lib/rails/initializable.rb:58:in `run_initializers' 38: from /app/vendor/ruby-2.6.6/lib/ruby/2.6.0/tsort.rb:205:in `tsort_each' 37: from /app/vendor/ruby-2.6.6/lib/ruby/2.6.0/tsort.rb:226:in `tsort_each' 36: from /app/vendor/ruby-2.6.6/lib/ruby/2.6.0/tsort.rb:347:in `each_strongly_connected_component' 35: from /app/vendor/ruby-2.6.6/lib/ruby/2.6.0/tsort.rb:347:in `call' 34: from /app/vendor/ruby-2.6.6/lib/ruby/2.6.0/tsort.rb:347:in `each' 33: from /app/vendor/ruby-2.6.6/lib/ruby/2.6.0/tsort.rb:349:in `block in each_strongly_connected_component' 32: from /app/vendor/ruby-2.6.6/lib/ruby/2.6.0/tsort.rb:415:in `each_strongly_connected_component_from' 31: from /app/vendor/ruby-2.6.6/lib/ruby/2.6.0/tsort.rb:415:in `call' 30: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.1.7/lib/rails/initializable.rb:48:in `tsort_each_child' 29: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.1.7/lib/rails/initializable.rb:48:in `each' 28: from /app/vendor/ruby-2.6.6/lib/ruby/2.6.0/tsort.rb:421:in `block in each_strongly_connected_component_from' 27: from /app/vendor/ruby-2.6.6/lib/ruby/2.6.0/tsort.rb:431:in `each_strongly_connected_component_from' 26: from /app/vendor/ruby-2.6.6/lib/ruby/2.6.0/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from' 25: from /app/vendor/ruby-2.6.6/lib/ruby/2.6.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component' 24: from /app/vendor/ruby-2.6.6/lib/ruby/2.6.0/tsort.rb:228:in `block in tsort_each' 23: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.1.7/lib/rails/initializable.rb:59:in `block in run_initializers' 22: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.1.7/lib/rails/initializable.rb:30:in `run' 21: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.1.7/lib/rails/initializable.rb:30:in `instance_exec' 20: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.1.7/lib/rails/engine.rb:611:in `block in <class:Engine>' 19: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.1.7/lib/rails/engine.rb:611:in `each' 18: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.1.7/lib/rails/engine.rb:612:in `block (2 levels) in <class:Engine>' 17: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.1.7/lib/rails/engine.rb:654:in `load_config_initializer' 16: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.1.7/lib/active_support/notifications.rb:168:in `instrument' 15: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.1.7/lib/rails/engine.rb:655:in `block in load_config_initializer' 14: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.1.7/lib/active_support/dependencies.rb:286:in `load' 13: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.1.7/lib/active_support/dependencies.rb:258:in `load_dependency' 12: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.1.7/lib/active_support/dependencies.rb:286:in `block in load' 11: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.1.7/lib/active_support/dependencies.rb:286:in `load' 10: from /app/config/initializers/carrier_wave.rb:2:in `<top (required)>' 9: from /app/vendor/bundle/ruby/2.6.0/gems/carrierwave-1.2.2/lib/carrierwave.rb:14:in `configure' 8: from /app/vendor/bundle/ruby/2.6.0/gems/carrierwave-1.2.2/lib/carrierwave/uploader/configuration.rb:159:in `configure' 7: from /app/config/initializers/carrier_wave.rb:4:in `block in <top (required)>' 6: from /app/vendor/bundle/ruby/2.6.0/gems/carrierwave-1.2.2/lib/carrierwave/uploader/configuration.rb:137:in `fog_credentials=' 5: from /app/vendor/bundle/ruby/2.6.0/gems/carrierwave-1.2.2/lib/carrierwave/uploader/configuration.rb:124:in `eager_load_fog' 4: from /app/vendor/bundle/ruby/2.6.0/gems/fog-core-1.45.0/lib/fog/storage.rb:27:in `new' 3: from /app/vendor/bundle/ruby/2.6.0/gems/fog-core-1.45.0/lib/fog/core/services_mixin.rb:16:in `new' 2: from /app/vendor/bundle/ruby/2.6.0/gems/fog-core-1.45.0/lib/fog/core/service.rb:98:in `new' 1: from /app/vendor/bundle/ruby/2.6.0/gems/fog-core-1.45.0/lib/fog/core/service.rb:268:in `handle_settings' /app/vendor/bundle/ruby/2.6.0/gems/fog-core-1.45.0/lib/fog/core/service.rb:244:in `validate_options': Missing required arguments: aws_access_key_id, aws_secret_access_key (ArgumentError)
carrier_wave.rb
if Rails.env.production? CarrierWave.configure do |config| config.fog_provider = 'fog/aws' config.fog_credentials = { # Amazon S3用の設定 :provider => 'AWS', :region => ENV['S3_REGION'], :aws_access_key_id => ENV['S3_ACCESS_KEY'], :aws_secret_access_key => ENV['S3_SECRET_KEY'] } config.fog_directory = ENV['S3_BUCKET'] end
試したこと
git config で環境変数を確認しましたが、問題はありませんでした。
「Missing required arguments: aws_access_key_id, aws_secret_access_key」
で検索してヒットする解決方法は一通り試してますが、解決には至りませんでした。
何卒、よろしくお願い致します。
補足情報(FW/ツールのバージョンなど)
Ruby 2.6.3
Rails 5.1.7
あなたの回答
tips
プレビュー