質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Ruby on Rails 5

Ruby on Rails 5は、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

Ruby

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

Q&A

0回答

180閲覧

rails デプロイ エラーについて

退会済みユーザー

退会済みユーザー

総合スコア0

Ruby on Rails 5

Ruby on Rails 5は、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

Ruby

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

0グッド

0クリップ

投稿2020/03/16 05:35

前提・実現したいこと

herokuにrailsで作成したappをあげるため、git push Heroku後、heroku pg:reset DATABASE、heroku run:detached rails db:migrate、そしてheroku run:detached rails db:seedをした後、heroku openをしたところapplication errorが出てしまいます。対処法を教えてください。

発生している問題・エラーメッセージ

Heroku logの結果を以下に示します。(エラー箇所のみ)

2020-03-16T05:12:07.046950+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=ancient-scrubland-55684.herokuapp.com request_id=f210e631-ce71-42a6-8192-3629233a0d50 fwd="133.35.37.111" dyno= connect= service= status=503 bytes= protocol=https

heroku heroku run rails cをすると以下のようになります。

Traceback (most recent call last): 47: from /app/bin/rails:9:in `<main>' 46: from /app/bin/rails:9:in `require' 45: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.1.6/lib/rails/commands.rb:16:in `<top (required)>' 44: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.1.6/lib/rails/command.rb:44:in `invoke' 43: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.1.6/lib/rails/command/base.rb:63:in `perform' 42: from /app/vendor/bundle/ruby/2.6.0/gems/thor-1.0.1/lib/thor.rb:392:in `dispatch' 41: from /app/vendor/bundle/ruby/2.6.0/gems/thor-1.0.1/lib/thor/invocation.rb:127:in `invoke_command' 40: from /app/vendor/bundle/ruby/2.6.0/gems/thor-1.0.1/lib/thor/command.rb:27:in `run' 39: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.1.6/lib/rails/commands/console/console_command.rb:96:in `perform' 38: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.1.6/lib/rails/command/actions.rb:16:in `require_application_and_environment!' 37: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.1.6/lib/rails/application.rb:329:in `require_environment!' 36: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.1.6/lib/rails/application.rb:329:in `require' 35: from /app/config/environment.rb:5:in `<top (required)>' 34: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.1.6/lib/rails/application.rb:353:in `initialize!' 33: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.1.6/lib/rails/initializable.rb:58:in `run_initializers' 32: from /app/vendor/ruby-2.6.5/lib/ruby/2.6.0/tsort.rb:205:in `tsort_each' 31: from /app/vendor/ruby-2.6.5/lib/ruby/2.6.0/tsort.rb:226:in `tsort_each' 30: from /app/vendor/ruby-2.6.5/lib/ruby/2.6.0/tsort.rb:347:in `each_strongly_connected_component' 29: from /app/vendor/ruby-2.6.5/lib/ruby/2.6.0/tsort.rb:347:in `call' 28: from /app/vendor/ruby-2.6.5/lib/ruby/2.6.0/tsort.rb:347:in `each' 27: from /app/vendor/ruby-2.6.5/lib/ruby/2.6.0/tsort.rb:349:in `block in each_strongly_connected_component' 26: from /app/vendor/ruby-2.6.5/lib/ruby/2.6.0/tsort.rb:431:in `each_strongly_connected_component_from' 25: from /app/vendor/ruby-2.6.5/lib/ruby/2.6.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component' 24: from /app/vendor/ruby-2.6.5/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.6/lib/rails/initializable.rb:59:in `block in run_initializers' 22: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.1.6/lib/rails/initializable.rb:30:in `run' 21: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.1.6/lib/rails/initializable.rb:30:in `instance_exec' 20: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.1.6/lib/rails/application/finisher.rb:67:in `block in <module:Finisher>' 19: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.1.6/lib/rails/application/finisher.rb:67:in `each' 18: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.1.6/lib/rails/engine.rb:354:in `eager_load!' 17: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.1.6/lib/rails/engine.rb:473:in `eager_load!' 16: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.1.6/lib/rails/engine.rb:473:in `each' 15: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.1.6/lib/rails/engine.rb:475:in `block in eager_load!' 14: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.1.6/lib/rails/engine.rb:475:in `each' 13: from /app/vendor/bundle/ruby/2.6.0/gems/railties-5.1.6/lib/rails/engine.rb:476:in `block (2 levels) in eager_load!' 12: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.1.6/lib/active_support/dependencies/interlock.rb:11:in `loading' 11: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.1.6/lib/active_support/concurrency/share_lock.rb:149:in `exclusive' 10: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.1.6/lib/active_support/dependencies/interlock.rb:12:in `block in loading' 9: from /app/app/models/micropost.rb:1:in `<top (required)>' 8: from /app/app/models/micropost.rb:4:in `<class:Micropost>' 7: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.1.6/lib/active_support/dependencies/interlock.rb:11:in `loading' 6: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.1.6/lib/active_support/concurrency/share_lock.rb:149:in `exclusive' 5: from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.1.6/lib/active_support/dependencies/interlock.rb:12:in `block in loading' 4: from /app/app/uploaders/picture_uploader.rb:1:in `<top (required)>' 3: from /app/app/uploaders/picture_uploader.rb:6:in `<class:PictureUploader>' 2: from /app/vendor/bundle/ruby/2.6.0/gems/carrierwave-1.2.2/lib/carrierwave/uploader/configuration.rb:78:in `storage' 1: from /app/vendor/bundle/ruby/2.6.0/gems/carrierwave-1.2.2/lib/carrierwave/uploader/configuration.rb:78:in `eval' (eval):1:in `storage': uninitialized constant CarrierWave::Storage::Fog (NameError)

該当のソースコード

CarrierWaveに関係しているファイルを以下に全て貼ります

source 'https://rubygems.org' gem 'rails', '5.1.6' gem 'rinku' gem 'bcrypt', '3.1.12' gem 'faker', '1.7.3' gem 'carrierwave', '1.2.2' gem 'mini_magick', '4.7.0' gem 'will_paginate', '3.1.6' gem 'bootstrap-will_paginate', '1.0.0' gem 'puma', '3.9.1' gem 'sass-rails', '5.0.6' gem 'uglifier', '3.2.0' gem 'coffee-rails', '4.2.2' gem 'jquery-rails', '4.3.1' gem 'jquery-ui-rails' gem 'turbolinks', '5.0.1' gem 'jbuilder', '2.7.0' group :development, :test do gem 'sqlite3', '1.3.13' gem 'byebug', '9.0.6', platform: :mri end group :development do gem 'web-console', '3.5.1' gem 'listen', '3.1.5' gem 'spring', '2.0.2' gem 'spring-watcher-listen', '2.0.1' end group :test do gem 'rails-controller-testing', '1.0.2' gem 'minitest', '5.10.3' gem 'minitest-reporters', '1.1.14' gem 'guard', '2.13.0' gem 'guard-minitest', '2.4.4' end group :production do gem 'pg', '< 1.0.0' gem 'fog', '1.42' end # Windows環境ではtzinfo-dataというgemを含める必要があります gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
class PictureUploader < CarrierWave::Uploader::Base include CarrierWave::MiniMagick process resize_to_limit: [200, 200] if Rails.env.production? storage :fog else storage :file end def store_dir "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}" end def extension_whitelist %w(jpg jpeg gif png) end end
if Rails.env.production? CarrierWave.configure do |config| config.fog_credentials = { # Amazon S3用の設定 :provider => 'AWS', :region => ENV['S3_REGION'], # 例: 'ap-northeast-1' :aws_access_key_id => ENV['S3_ACCESS_KEY'], :aws_secret_access_key => ENV['S3_SECRET_KEY'] } config.fog_directory = ENV['S3_BUCKET'] end end

試したこと

ここに問題に対して試したことを記載してください。

補足情報(FW/ツールのバージョンなど)

開発環境ではエラーは起きません

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだ回答がついていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問