質問編集履歴

2 マークダウン形式にしました

kattyan53

kattyan53 score 7

2018/01/06 20:42  投稿

uninitialized constant CarrierWave (NameError)について
###前提・実現したいこと
CarrierWaveのgemをinstallしたアプリケーションを作成し、
herokuにデプロイしたいです。
ローカルでは、正常に動作しています。
###発生している問題・エラーメッセージ
```
エラーメッセージ
```
◆怪しいエラー抜粋
2018-01-06T08:49:06.822852+00:00 app[web.1]: /app/app/uploaders/image_uploader.rb:1:in `<top (required)>’: uninitialized constant CarrierWave (NameError)
◆heroku logs -t で確認したエラー全部
```  
Running rails c on ⬢ mighty-chamber-27044... up, run.1965 (Free)
/app/app/uploaders/image_uploader.rb:1:in `<top (required)>': uninitialized constant CarrierWave (NameError)
       from /app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.1.4/lib/active_support/dependencies/interlock.rb:12:in `block in loading'
       from /app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.1.4/lib/active_support/concurrency/share_lock.rb:149:in `exclusive'
       from /app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.1.4/lib/active_support/dependencies/interlock.rb:11:in `loading'
       from /app/app/models/feed.rb:2:in `<class:Feed>'
       from /app/app/models/feed.rb:1:in `<top (required)>'
       from /app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.1.4/lib/active_support/dependencies/interlock.rb:12:in `block in loading'
       from /app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.1.4/lib/active_support/concurrency/share_lock.rb:149:in `exclusive'
       from /app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.1.4/lib/active_support/dependencies/interlock.rb:11:in `loading'
       from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/engine.rb:476:in `block (2 levels) in eager_load!'
       from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/engine.rb:475:in `each'
       from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/engine.rb:475:in `block in eager_load!'
       from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/engine.rb:473:in `each'
       from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/engine.rb:473:in `eager_load!'
       from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/engine.rb:354:in `eager_load!'
       from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/application/finisher.rb:67:in `each'
       from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/application/finisher.rb:67:in `block in <module:Finisher>'
       from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/initializable.rb:30:in `instance_exec'
       from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/initializable.rb:30:in `run'
       from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/initializable.rb:59:in `block in run_initializers'
       from /app/vendor/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:228:in `block in tsort_each'
       from /app/vendor/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
       from /app/vendor/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:431:in `each_strongly_connected_component_from'
       from /app/vendor/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:349:in `block in each_strongly_connected_component'
       from /app/vendor/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:347:in `each'
       from /app/vendor/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:347:in `call'
       from /app/vendor/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:347:in `each_strongly_connected_component'
       from /app/vendor/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:226:in `tsort_each'
       from /app/vendor/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:205:in `tsort_each'
       from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/initializable.rb:58:in `run_initializers'
       from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/application.rb:353:in `initialize!'
       from /app/config/environment.rb:5:in `<top (required)>'
       from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/application.rb:329:in `require'
       from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/application.rb:329:in `require_environment!'
       from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/command/actions.rb:16:in `require_application_and_environment!'
       from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/commands/console/console_command.rb:96:in `perform'
       from /app/vendor/bundle/ruby/2.3.0/gems/thor-0.20.0/lib/thor/command.rb:27:in `run'
       from /app/vendor/bundle/ruby/2.3.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command'
       from /app/vendor/bundle/ruby/2.3.0/gems/thor-0.20.0/lib/thor.rb:387:in `dispatch'
       from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/command/base.rb:63:in `perform'
       from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/command.rb:44:in `invoke'
       from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/commands.rb:16:in `<top (required)>'
       from /app/bin/rails:9:in `require'
       from /app/bin/rails:9:in `<main>'
```
###該当のソースコード
Ruby on Rails
Gemfile
group :development do
 gem 'web-console', '>= 3.3.0'
 gem 'listen', '>= 3.0.5', '< 3.2'
 gem 'spring'
 gem 'spring-watcher-listen', '~> 2.0.0'
 gem 'bcrypt', '3.1.11'
 gem 'better_errors'
 gem 'binding_of_caller'
 gem 'carrierwave', '~> 1.0'
 gem 'mini_magick'
 gem 'letter_opener_web'
 gem 'letter_opener', group: :development
end
###補足情報(言語/FW/ツール等のバージョンなど)
cloud9で作っています。
  • Ruby

    15921 questions

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

  • Ruby on Rails

    17087 questions

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

1 より詳細なエラーを見つけたので、変更しました。

kattyan53

kattyan53 score 7

2018/01/06 20:21  投稿

uninitialized constant CarrierWave (NameError)について
###前提・実現したいこと
CarrierWaveのgemをinstallしたアプリケーションを作成し、
herokuにデプロイしたいです。
ローカルでは、正常に動作しています。
###発生している問題・エラーメッセージ
```
エラーメッセージ
```
◆怪しいエラー抜粋
2018-01-06T08:49:06.822852+00:00 app[web.1]: /app/app/uploaders/image_uploader.rb:1:in `<top (required)>’: uninitialized constant CarrierWave (NameError)
◆heroku logs -t で確認したエラー全部
username:~/workspace/tw (master) $ heroku logs -t
▸ heroku-cli: update available from 6.14.39-addc925 to 6.15.11-5cba33c
2018-01-06T08:47:59.085533+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.3.0/gems/rack-2.0.3/lib/rack/builder.rb:49:in new_from_string' 2018-01-06T08:47:59.085521+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/initializable.rb:58:in run_initializers’
2018-01-06T08:47:59.085523+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/application.rb:353:in initialize!' 2018-01-06T08:47:59.085527+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.3.0/gems/rack-2.0.3/lib/rack/builder.rb:55:in instance_eval’
〜〜中略〜〜
2018-01-06T08:49:07.978654+00:00 heroku[router]: at=error code=H10 desc=”App crashed” method=GET path=”/” host=mighty-chamber-27044.herokuapp.com request_id=7e85185c-1e7a-441e-81a3-3a35dd1dcb26 fwd=”36.12.25.147” dyno= connect= service= status=503 bytes= protocol=https
2018-01-06T08:49:08.470364+00:00 heroku[router]: at=error code=H10 desc=”App crashed” method=GET path=”/favicon.ico” host=mighty-chamber-27044.herokuapp.com request_id=a8fdb3ff-6873-4d55-bb1b-396b2835fca4 fwd=”36.12.25.147” dyno= connect= service= status=503 bytes= protocol=https
Running rails c on ⬢ mighty-chamber-27044... up, run.1965 (Free)
/app/app/uploaders/image_uploader.rb:1:in `<top (required)>': uninitialized constant CarrierWave (NameError)
       from /app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.1.4/lib/active_support/dependencies/interlock.rb:12:in `block in loading'
       from /app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.1.4/lib/active_support/concurrency/share_lock.rb:149:in `exclusive'
       from /app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.1.4/lib/active_support/dependencies/interlock.rb:11:in `loading'
       from /app/app/models/feed.rb:2:in `<class:Feed>'
       from /app/app/models/feed.rb:1:in `<top (required)>'
       from /app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.1.4/lib/active_support/dependencies/interlock.rb:12:in `block in loading'
       from /app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.1.4/lib/active_support/concurrency/share_lock.rb:149:in `exclusive'
       from /app/vendor/bundle/ruby/2.3.0/gems/activesupport-5.1.4/lib/active_support/dependencies/interlock.rb:11:in `loading'
       from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/engine.rb:476:in `block (2 levels) in eager_load!'
       from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/engine.rb:475:in `each'
       from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/engine.rb:475:in `block in eager_load!'
       from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/engine.rb:473:in `each'
       from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/engine.rb:473:in `eager_load!'
       from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/engine.rb:354:in `eager_load!'
       from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/application/finisher.rb:67:in `each'
       from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/application/finisher.rb:67:in `block in <module:Finisher>'
       from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/initializable.rb:30:in `instance_exec'
       from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/initializable.rb:30:in `run'
       from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/initializable.rb:59:in `block in run_initializers'
       from /app/vendor/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:228:in `block in tsort_each'
       from /app/vendor/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
       from /app/vendor/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:431:in `each_strongly_connected_component_from'
       from /app/vendor/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:349:in `block in each_strongly_connected_component'
       from /app/vendor/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:347:in `each'
       from /app/vendor/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:347:in `call'
       from /app/vendor/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:347:in `each_strongly_connected_component'
       from /app/vendor/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:226:in `tsort_each'
       from /app/vendor/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:205:in `tsort_each'
       from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/initializable.rb:58:in `run_initializers'
       from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/application.rb:353:in `initialize!'
       from /app/config/environment.rb:5:in `<top (required)>'
       from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/application.rb:329:in `require'
       from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/application.rb:329:in `require_environment!'
       from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/command/actions.rb:16:in `require_application_and_environment!'
       from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/commands/console/console_command.rb:96:in `perform'
       from /app/vendor/bundle/ruby/2.3.0/gems/thor-0.20.0/lib/thor/command.rb:27:in `run'
       from /app/vendor/bundle/ruby/2.3.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command'
       from /app/vendor/bundle/ruby/2.3.0/gems/thor-0.20.0/lib/thor.rb:387:in `dispatch'
       from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/command/base.rb:63:in `perform'
       from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/command.rb:44:in `invoke'
       from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/commands.rb:16:in `<top (required)>'
       from /app/bin/rails:9:in `require'
       from /app/bin/rails:9:in `<main>'
###該当のソースコード
Ruby on Rails
Gemfile
group :development do
 gem 'web-console', '>= 3.3.0'
 gem 'listen', '>= 3.0.5', '< 3.2'
 gem 'spring'
 gem 'spring-watcher-listen', '~> 2.0.0'
 gem 'bcrypt', '3.1.11'
 gem 'better_errors'
 gem 'binding_of_caller'
 gem 'carrierwave', '~> 1.0'
 gem 'mini_magick'
 gem 'letter_opener_web'
 gem 'letter_opener', group: :development
end
###補足情報(言語/FW/ツール等のバージョンなど)
cloud9で作っています。
  • Ruby

    15921 questions

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

  • Ruby on Rails

    17087 questions

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

思考するエンジニアのためのQ&Aサイト「teratail」について詳しく知る