質問編集履歴

1 エラー内容の追加

ngron1210

ngron1210 score 6

2018/06/19 21:59  投稿

Herokuにデプロイ後、AppricationErrorが発生してしまう。
### 前提・実現したいこと
RailsTutorialで、herokuにデプロイ後、`heroku open`を実行して画面を確認したいのですが、
**Application error**
An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details.
という画面表示されてしまいます。
###エラー内容
`heroku run rails c` で、エラーメッセージを確認したところ、次のようなログが出てきました。
```
/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- bundler (LoadError)
   from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
   from /app/bin/spring:8:in `<top (required)>'
   from /app/bin/rails:3:in `load'
   from /app/bin/rails:3:in `<main>'
```
色々調べてみるとbundlerのバージョンが違うと書いてあり、いろんなバージョンで試してみたのですが、ダメでした。
現在のバージョン → `Bundler version 1.16.2`
ローカル環境ではちゃんと動くのですが、本番環境になると、うまくいきません。
何が原因なのでしょうか?
よろしくお願いいたします🙇‍♂️
###開発環境
・heroku
・Ruby 2.5.1
・Rails 5.1.4
・Rails 5.1.4
##追記
herokuで初めてデプロイした時から、上記のエラーが発生しておりました。
それ以来、`git push heroku` を実行しておりますが、同じようなエラーが発生しております。
`hroku logs`の結果は以下のようになります🙇‍♂️
```
2018-06-17T10:08:02.885286+00:00 heroku[web.1]: State changed from crashed to starting
2018-06-17T10:08:04.601622+00:00 heroku[web.1]: Starting process with command `npm start`
2018-06-17T10:08:06.680310+00:00 app[web.1]: npm ERR! missing script: start
2018-06-17T10:08:06.686084+00:00 app[web.1]:
2018-06-17T10:08:06.686398+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2018-06-17T10:08:06.686510+00:00 app[web.1]: npm ERR!    /app/.npm/_logs/2018-06-17T10_08_06_681Z-debug.log
2018-06-17T10:08:06.765355+00:00 heroku[web.1]: State changed from starting to crashed
2018-06-17T10:08:06.742437+00:00 heroku[web.1]: Process exited with status 1
2018-06-17T15:36:32.754158+00:00 heroku[web.1]: State changed from crashed to starting
2018-06-17T15:36:34.786785+00:00 heroku[web.1]: Starting process with command `npm start`
2018-06-17T15:36:37.478385+00:00 heroku[web.1]: Process exited with status 1
2018-06-17T15:36:37.507581+00:00 heroku[web.1]: State changed from starting to crashed
2018-06-17T15:36:37.386087+00:00 app[web.1]: npm ERR! missing script: start
2018-06-17T15:36:37.393485+00:00 app[web.1]:
2018-06-17T15:36:37.393725+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2018-06-17T15:36:37.393858+00:00 app[web.1]: npm ERR!    /app/.npm/_logs/2018-06-17T15_36_37_387Z-debug.log
2018-06-17T21:20:48.316996+00:00 heroku[web.1]: State changed from crashed to starting
2018-06-17T21:20:50.195702+00:00 heroku[web.1]: Starting process with command `npm start`
2018-06-17T21:20:52.687722+00:00 heroku[web.1]: State changed from starting to crashed
2018-06-17T21:20:52.652699+00:00 heroku[web.1]: Process exited with status 1
2018-06-17T21:20:52.579329+00:00 app[web.1]: npm ERR! missing script: start
2018-06-17T21:20:52.586247+00:00 app[web.1]:
2018-06-17T21:20:52.586310+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2018-06-17T21:20:52.586424+00:00 app[web.1]: npm ERR!    /app/.npm/_logs/2018-06-17T21_20_52_580Z-debug.log
2018-06-18T03:05:08.775816+00:00 heroku[web.1]: State changed from crashed to starting
2018-06-18T03:05:10.637040+00:00 heroku[web.1]: Starting process with command `npm start`
2018-06-18T03:05:12.886575+00:00 heroku[web.1]: Process exited with status 1
2018-06-18T03:05:12.913687+00:00 heroku[web.1]: State changed from starting to crashed
2018-06-18T03:05:12.825487+00:00 app[web.1]: npm ERR! missing script: start
2018-06-18T03:05:12.830823+00:00 app[web.1]:
2018-06-18T03:05:12.831023+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2018-06-18T03:05:12.831130+00:00 app[web.1]: npm ERR!    /app/.npm/_logs/2018-06-18T03_05_12_826Z-debug.log
2018-06-18T08:57:27.598935+00:00 heroku[web.1]: State changed from crashed to starting
2018-06-18T08:57:29.208833+00:00 heroku[web.1]: Starting process with command `npm start`
2018-06-18T08:57:31.105768+00:00 app[web.1]: npm ERR! missing script: start
2018-06-18T08:57:31.111388+00:00 app[web.1]:
2018-06-18T08:57:31.111594+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2018-06-18T08:57:31.111665+00:00 app[web.1]: npm ERR!    /app/.npm/_logs/2018-06-18T08_57_31_107Z-debug.log
2018-06-18T08:57:31.187516+00:00 heroku[web.1]: State changed from starting to crashed
2018-06-18T08:57:31.169741+00:00 heroku[web.1]: Process exited with status 1
2018-06-18T15:05:48.190915+00:00 heroku[web.1]: State changed from crashed to starting
2018-06-18T15:05:50.722944+00:00 heroku[web.1]: Starting process with command `npm start`
2018-06-18T15:05:54.458325+00:00 heroku[web.1]: Process exited with status 1
2018-06-18T15:05:54.508569+00:00 heroku[web.1]: State changed from starting to crashed
2018-06-18T15:05:54.359456+00:00 app[web.1]: npm ERR! missing script: start
2018-06-18T15:05:54.382228+00:00 app[web.1]:
2018-06-18T15:05:54.390096+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2018-06-18T15:05:54.390312+00:00 app[web.1]: npm ERR!    /app/.npm/_logs/2018-06-18T15_05_54_373Z-debug.log
2018-06-18T21:09:16.503082+00:00 heroku[web.1]: State changed from crashed to starting
2018-06-18T21:09:18.257452+00:00 heroku[web.1]: Starting process with command `npm start`
2018-06-18T21:09:20.441757+00:00 heroku[web.1]: State changed from starting to crashed
2018-06-18T21:09:20.359245+00:00 app[web.1]: npm ERR! missing script: start
2018-06-18T21:09:20.364977+00:00 app[web.1]:
2018-06-18T21:09:20.365150+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2018-06-18T21:09:20.365235+00:00 app[web.1]: npm ERR!    /app/.npm/_logs/2018-06-18T21_09_20_360Z-debug.log
2018-06-18T21:09:20.427914+00:00 heroku[web.1]: Process exited with status 1
2018-06-19T02:53:39.141015+00:00 heroku[web.1]: State changed from crashed to starting
2018-06-19T02:53:40.765653+00:00 heroku[web.1]: Starting process with command `npm start`
2018-06-19T02:53:42.559104+00:00 app[web.1]: npm ERR! missing script: start
2018-06-19T02:53:42.568308+00:00 app[web.1]:
2018-06-19T02:53:42.568507+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2018-06-19T02:53:42.568589+00:00 app[web.1]: npm ERR!    /app/.npm/_logs/2018-06-19T02_53_42_561Z-debug.log
2018-06-19T02:53:42.646686+00:00 heroku[web.1]: State changed from starting to crashed
2018-06-19T02:53:42.619570+00:00 heroku[web.1]: Process exited with status 1
2018-06-19T08:38:02.778029+00:00 heroku[web.1]: State changed from crashed to starting
2018-06-19T08:38:07.004789+00:00 heroku[web.1]: Starting process with command `npm start`
2018-06-19T08:38:10.488636+00:00 heroku[web.1]: State changed from starting to crashed
2018-06-19T08:38:10.470072+00:00 heroku[web.1]: Process exited with status 1
2018-06-19T08:38:10.330360+00:00 app[web.1]: npm ERR! missing script: start
2018-06-19T08:38:10.362553+00:00 app[web.1]:
2018-06-19T08:38:10.366206+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2018-06-19T08:38:10.367256+00:00 app[web.1]: npm ERR!    /app/.npm/_logs/2018-06-19T08_38_10_338Z-debug.log
2018-06-19T12:52:45.000000+00:00 app[api]: Build started by user syumuu1219@outlook.jp
2018-06-19T12:52:53.974159+00:00 app[api]: Deploy 9b9d8608 by user syumuu1219@outlook.jp
2018-06-19T12:52:53.974159+00:00 app[api]: Release v5 created by user syumuu1219@outlook.jp
2018-06-19T12:52:54.000000+00:00 app[api]: Build succeeded
2018-06-19T12:52:54.654763+00:00 heroku[web.1]: State changed from crashed to starting
2018-06-19T12:52:56.265080+00:00 heroku[web.1]: Starting process with command `npm start`
2018-06-19T12:52:58.181451+00:00 app[web.1]: npm ERR! missing script: start
2018-06-19T12:52:58.187326+00:00 app[web.1]:
2018-06-19T12:52:58.187483+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2018-06-19T12:52:58.187575+00:00 app[web.1]: npm ERR!    /app/.npm/_logs/2018-06-19T12_52_58_182Z-debug.log
2018-06-19T12:52:58.351754+00:00 heroku[web.1]: State changed from starting to crashed
2018-06-19T12:52:58.354363+00:00 heroku[web.1]: State changed from crashed to starting
2018-06-19T12:52:58.227330+00:00 heroku[web.1]: Process exited with status 1
2018-06-19T12:53:00.503935+00:00 heroku[web.1]: Starting process with command `npm start`
2018-06-19T12:53:02.889472+00:00 app[web.1]: npm ERR! missing script: start
2018-06-19T12:53:02.903068+00:00 app[web.1]:
2018-06-19T12:53:02.903332+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2018-06-19T12:53:02.903462+00:00 app[web.1]: npm ERR!    /app/.npm/_logs/2018-06-19T12_53_02_890Z-debug.log
2018-06-19T12:53:02.963573+00:00 heroku[web.1]: Process exited with status 1
2018-06-19T12:53:03.175447+00:00 heroku[web.1]: State changed from starting to crashed
2018-06-19T12:53:03.900541+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=murmuring-falls-47215.herokuapp.com request_id=6d106165-9a07-47ab-ae7f-1a09abe110ae fwd="39.110.216.71" dyno= connect= service= status=503 bytes= protocol=https
2018-06-19T12:53:04.527828+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=murmuring-falls-47215.herokuapp.com request_id=4d0b9f2e-c0c2-4584-bbc0-e748c8bfa4db fwd="39.110.216.71" dyno= connect= service= status=503 bytes= protocol=https
2018-06-19T12:53:14.674464+00:00 app[api]: Starting process with command `rails c` by user syumuu1219@outlook.jp
2018-06-19T12:53:16.977353+00:00 heroku[run.4339]: Awaiting client
2018-06-19T12:53:17.024568+00:00 heroku[run.4339]: Starting process with command `rails c`
2018-06-19T12:53:17.129170+00:00 heroku[run.4339]: State changed from starting to up
2018-06-19T12:53:21.594186+00:00 heroku[run.4339]: State changed from up to complete
2018-06-19T12:53:21.580562+00:00 heroku[run.4339]: Process exited with status 1
```
  • Ruby

    13369 questions

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

  • Heroku

    1951 questions

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

  • Ruby on Rails 5

    5083 questions

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

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