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

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

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

Unicornは、汎用のRackアプリケーションサーバ。RackとWebサーバーの機能を併せ持ちます。レスポンス処理や、Nginx単体がRackの機能をサポートしていない事から、一般的にはNginx+Unicorn+Railsの構成を取って用います。

Heroku

HerokuはHeroku社が開発と運営を行っているPaaSの名称です。RubyやNode.js、Python、そしてJVMベース(Java、Scala、Clojureなど)の複数のプログラミング言語をサポートしている。

Ruby on Rails

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

Q&A

解決済

2回答

1535閲覧

herokuデプロイ時のunicorn読み込みエラー

hata11

総合スコア8

unicorn

Unicornは、汎用のRackアプリケーションサーバ。RackとWebサーバーの機能を併せ持ちます。レスポンス処理や、Nginx単体がRackの機能をサポートしていない事から、一般的にはNginx+Unicorn+Railsの構成を取って用います。

Heroku

HerokuはHeroku社が開発と運営を行っているPaaSの名称です。RubyやNode.js、Python、そしてJVMベース(Java、Scala、Clojureなど)の複数のプログラミング言語をサポートしている。

Ruby on Rails

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

0グッド

0クリップ

投稿2017/04/22 10:10

編集2017/04/22 10:49

###前提・実現したいこと

cloud9で作成したRuby on Railsアプリケーションをherokuへデプロイした際に、アプリケーションエラーとなってしまい、ログにエラーが出てしまいました。
どなたかわかる方、いらっしゃいましたらお願いします!

###発生している問題・エラーメッセージ
logs -tで取得したログは以下の通りとなります。
自分では、ここが原因かと思っていますが、解決法見つけられていません。
※CarrierWaveは使用していないのですが、そこも不明な点です

bundler: failed to load command: unicorn (/app/vendor/bundle/ruby/2.3.0/bin/unicorn)
NameError: uninitialized constant CarrierWave

2017-04-22T09:35:57.000000+00:00 app[api]: Build succeeded 2017-04-22T09:36:30.266071+00:00 heroku[web.1]: Starting process with command `bundle exec unicorn -p 43511 -c ./config/unicorn.rb` 2017-04-22T09:36:32.232595+00:00 app[web.1]: I, [2017-04-22T09:36:32.232514 #4] INFO -- : Refreshing Gem list 2017-04-22T09:36:33.427947+00:00 app[web.1]: bundler: failed to load command: unicorn (/app/vendor/bundle/ruby/2.3.0/bin/unicorn) 2017-04-22T09:36:33.428026+00:00 app[web.1]: NameError: uninitialized constant CarrierWave 2017-04-22T09:36:33.428027+00:00 app[web.1]: /app/app/uploaders/picture_uploader.rb:1:in `<top (required)>' 2017-04-22T09:36:33.428030+00:00 app[web.1]: /app/vendor/bundle/ruby/2.3.0/gems/railties-4.2.5/lib/rails/engine.rb:472:in `block (2 levels) in eager_load!' 2017-04-22T09:36:33.428031+00:00 app[web.1]: /app/vendor/bundle/ruby/2.3.0/gems/railties-4.2.5/lib/rails/engine.rb:471:in `each' 2017-04-22T09:36:33.428032+00:00 app[web.1]: /app/vendor/bundle/ruby/2.3.0/gems/railties-4.2.5/lib/rails/engine.rb:471:in `block in eager_load!' 2017-04-22T09:36:33.428033+00:00 app[web.1]: /app/vendor/bundle/ruby/2.3.0/gems/railties-4.2.5/lib/rails/engine.rb:469:in `each' 2017-04-22T09:36:33.428034+00:00 app[web.1]: /app/vendor/bundle/ruby/2.3.0/gems/railties-4.2.5/lib/rails/engine.rb:469:in `eager_load!' 2017-04-22T09:36:33.428035+00:00 app[web.1]: /app/vendor/bundle/ruby/2.3.0/gems/railties-4.2.5/lib/rails/engine.rb:346:in `eager_load!' 2017-04-22T09:36:33.428035+00:00 app[web.1]: /app/vendor/bundle/ruby/2.3.0/gems/railties-4.2.5/lib/rails/application/finisher.rb:56:in `each' 2017-04-22T09:36:33.428036+00:00 app[web.1]: /app/vendor/bundle/ruby/2.3.0/gems/railties-4.2.5/lib/rails/application/finisher.rb:56:in `block in <module:Finisher>' 2017-04-22T09:36:33.428037+00:00 app[web.1]: /app/vendor/bundle/ruby/2.3.0/gems/railties-4.2.5/lib/rails/initializable.rb:30:in `instance_exec' 2017-04-22T09:36:33.428038+00:00 app[web.1]: /app/vendor/bundle/ruby/2.3.0/gems/railties-4.2.5/lib/rails/initializable.rb:30:in `run' 2017-04-22T09:36:33.428038+00:00 app[web.1]: /app/vendor/bundle/ruby/2.3.0/gems/railties-4.2.5/lib/rails/initializable.rb:55:in `block in run_initializers' 2017-04-22T09:36:33.428039+00:00 app[web.1]: /app/vendor/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:228:in `block in tsort_each' 2017-04-22T09:36:33.428040+00:00 app[web.1]: /app/vendor/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component' 2017-04-22T09:36:33.428041+00:00 app[web.1]: /app/vendor/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:431:in `each_strongly_connected_component_from' 2017-04-22T09:36:33.428041+00:00 app[web.1]: /app/vendor/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:349:in `block in each_strongly_connected_component' 2017-04-22T09:36:33.428042+00:00 app[web.1]: /app/vendor/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:347:in `each' 2017-04-22T09:36:33.428043+00:00 app[web.1]: /app/vendor/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:347:in `call' 2017-04-22T09:36:33.428043+00:00 app[web.1]: /app/vendor/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:347:in `each_strongly_connected_component' 2017-04-22T09:36:33.428044+00:00 app[web.1]: /app/vendor/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:226:in `tsort_each' 2017-04-22T09:36:33.428045+00:00 app[web.1]: /app/vendor/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:205:in `tsort_each' 2017-04-22T09:36:33.428046+00:00 app[web.1]: /app/vendor/bundle/ruby/2.3.0/gems/railties-4.2.5/lib/rails/initializable.rb:54:in `run_initializers' 2017-04-22T09:36:33.428046+00:00 app[web.1]: /app/vendor/bundle/ruby/2.3.0/gems/railties-4.2.5/lib/rails/application.rb:352:in `initialize!' 2017-04-22T09:36:33.428047+00:00 app[web.1]: /app/config/environment.rb:5:in `<top (required)>' 2017-04-22T09:36:33.428048+00:00 app[web.1]: config.ru:4:in `require' 2017-04-22T09:36:33.428048+00:00 app[web.1]: config.ru:4:in `block in <main>' 2017-04-22T09:36:33.428049+00:00 app[web.1]: /app/vendor/bundle/ruby/2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in `instance_eval' 2017-04-22T09:36:33.428050+00:00 app[web.1]: /app/vendor/bundle/ruby/2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in `initialize' 2017-04-22T09:36:33.428050+00:00 app[web.1]: config.ru:1:in `new' 2017-04-22T09:36:33.428051+00:00 app[web.1]: config.ru:1:in `<main>' 2017-04-22T09:36:33.428052+00:00 app[web.1]: /app/vendor/bundle/ruby/2.3.0/gems/unicorn-5.3.0/lib/unicorn.rb:56:in `eval' 2017-04-22T09:36:33.428053+00:00 app[web.1]: /app/vendor/bundle/ruby/2.3.0/gems/unicorn-5.3.0/lib/unicorn.rb:56:in `block in builder' 2017-04-22T09:36:33.428053+00:00 app[web.1]: /app/vendor/bundle/ruby/2.3.0/gems/unicorn-5.3.0/lib/unicorn/http_server.rb:796:in `build_app!' 2017-04-22T09:36:33.428054+00:00 app[web.1]: /app/vendor/bundle/ruby/2.3.0/gems/unicorn-5.3.0/lib/unicorn/http_server.rb:139:in `start' 2017-04-22T09:36:33.428055+00:00 app[web.1]: /app/vendor/bundle/ruby/2.3.0/gems/unicorn-5.3.0/bin/unicorn:126:in `<top (required)>' 2017-04-22T09:36:33.428055+00:00 app[web.1]: /app/vendor/bundle/ruby/2.3.0/bin/unicorn:22:in `load' 2017-04-22T09:36:33.428056+00:00 app[web.1]: /app/vendor/bundle/ruby/2.3.0/bin/unicorn:22:in `<top (required)>' 2017-04-22T09:36:33.545839+00:00 heroku[web.1]: State changed from starting to crashed 2017-04-22T09:36:33.547117+00:00 heroku[web.1]: State changed from crashed to starting 2017-04-22T09:36:33.535113+00:00 heroku[web.1]: Process exited with status 1 2017-04-22T09:36:38.924926+00:00 heroku[web.1]: Starting process with command `bundle exec unicorn -p 3088 -c ./config/unicorn.rb` 2017-04-22T09:36:41.077577+00:00 app[web.1]: I, [2017-04-22T09:36:41.077475 #4] INFO -- : Refreshing Gem list 2017-04-22T09:36:42.364947+00:00 app[web.1]: bundler: failed to load command: unicorn (/app/vendor/bundle/ruby/2.3.0/bin/unicorn) 2017-04-22T09:36:42.365047+00:00 app[web.1]: NameError: uninitialized constant CarrierWave 〜繰り返し部分省略〜 2017-04-22T09:37:01.025518+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=xxxxxx.herokuapp.com request_id=ace3c88a-37a3-42ff-8974-40bfab557408 fwd="xxx.xxx.xx.xxx" dyno= connect= service= status=503 bytes= protocol=https 2017-04-22T09:37:01.628842+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=xxxxxx.herokuapp.com request_id=52fcbc7e-73aa-4a49-af75-3a769487b65e fwd="xxx.xxx.xx.xxx" dyno= connect= service= status=503 bytes= protocol=https 2017-04-22T09:44:32.481699+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=xxxxxx.herokuapp.com request_id=5276a3a5-6e75-4b38-aaad-acd4f5251a99 fwd="xxx.xxx.xx.xxx" dyno= connect= service= status=503 bytes= protocol=https 2017-04-22T09:44:33.360437+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=xxxxxx.herokuapp.com request_id=337ad730-7f2e-4e55-9f87-eb830815e94c fwd="xxx.xxx.xx.xxx" dyno= connect= service= status=503 bytes= protocol=https

###該当のソースコード

◆ /Procfile web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb ◆ /config/unicorn.rb #config/unicorn.rb worker_processes 1 timeout 30 preload_app true before_fork do |server, worker| Signal.trap 'TERM' do puts 'Unicorn master intercepting TERM and sending myself QUIT instead' Process.kill 'QUIT', Process.pid end defined?(ActiveRecord::Base) and ActiveRecord::Base.connection.disconnect! end after_fork do |server, worker| Signal.trap 'TERM' do puts 'Unicorn worker intercepting TERM and doing nothing. Wait for master to sent QUIT' end defined?(ActiveRecord::Base) and ActiveRecord::Base.establish_connection end ◆ /Gemfileにはgem 'unicorn'を記載しています

###補足情報(言語/FW/ツール等のバージョンなど)
ruby '2.3.4'

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

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

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

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

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

guest

回答2

0

覚えていたらでよいのですが、似たようなunicorn関連でのアプリケーションエラーが出てるのですが、
どういった解決方法になりましたでしょうか。参考でお聞かせ願えればと思います。宜しくお願い致します。

投稿2018/10/20 15:21

Rand

総合スコア18

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

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

0

自己解決

自力で調べ、どうにかなりましたので、クローズさせていただきます。
お騒がせ致しました

投稿2017/04/22 14:49

hata11

総合スコア8

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

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

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問