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

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

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

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

Ruby on Rails

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

Q&A

解決済

2回答

4041閲覧

railsアプリケーションのheroku上でのデプロイエラー

hata11

総合スコア8

Heroku

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

Ruby on Rails

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

0グッド

0クリップ

投稿2017/04/16 19:05

編集2017/04/20 05:33

###前提・実現したいこと
railsで自作アプリケーション作成後に、herokuでデプロイしたところ、エラーログが出てしまいました(アプリケーションエラー)。
1、2日格闘したのですが、よくわからず。わかる方いらっしゃいましたらどうかご教授頂きたくお願いいたします!

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

heroku上でのエラーログは以下の通りです

◆4/20 logs -tにて出力したものに入れ替えました 2017-04-19T13:32:38.000000+00:00 app[api]: Build started by user xxxxxxx@xxxxx.jp 2017-04-19T13:33:09.294751+00:00 app[api]: Deploy a7ef171 by user xxxxxxx@xxxxx.jp 2017-04-19T13:33:09.294751+00:00 app[api]: Release v11 created by user xxxxxxx@xxxxx.jp 2017-04-19T13:33:09.536227+00:00 app[api]: Release v11 created by user xxxxxxx@xxxxx.jp 2017-04-19T13:33:09.705955+00:00 heroku[web.1]: State changed from crashed to starting 2017-04-19T13:32:38.000000+00:00 app[api]: Build succeeded 2017-04-19T13:33:14.958238+00:00 heroku[web.1]: Starting process with command `bundle exec puma -C config/puma.rb` 2017-04-19T13:33:17.093245+00:00 app[web.1]: bundler: command not found: puma 2017-04-19T13:33:17.093264+00:00 app[web.1]: Install missing gem executables with `bundle install` 2017-04-19T13:33:17.202130+00:00 heroku[web.1]: Process exited with status 127 2017-04-19T13:33:17.204629+00:00 heroku[web.1]: State changed from starting to crashed 2017-04-19T13:33:17.205832+00:00 heroku[web.1]: State changed from crashed to starting 2017-04-19T13:33:22.722671+00:00 heroku[web.1]: Starting process with command `bundle exec puma -C config/puma.rb` 2017-04-19T13:33:25.005327+00:00 heroku[web.1]: Process exited with status 127 2017-04-19T13:33:24.927978+00:00 app[web.1]: bundler: command not found: puma 2017-04-19T13:33:24.928001+00:00 app[web.1]: Install missing gem executables with `bundle install` 2017-04-19T13:33:25.017683+00:00 heroku[web.1]: State changed from starting to crashed 2017-04-19T13:35:08.118659+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=xxxxxxx.herokuapp.com request_id=9c064dcb-6560-4066-bf8c-c75d9d82f5de fwd="xxx.xxx.xxx.xx" dyno= connect= service= status=503 bytes= protocol=https 2017-04-19T13:35:08.766013+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=xxxxx.herokuapp.com request_id=ee2bb605-9267-4580-ad34-fe1e6a010504 fwd="xxx.xx.xxx.xx" dyno= connect= service= status=503 bytes= protocol=https 2017-04-19T14:05:22.832782+00:00 heroku[web.1]: State changed from crashed to starting 2017-04-19T14:05:29.832761+00:00 heroku[web.1]: Starting process with command `bundle exec puma -C config/puma.rb` 2017-04-19T14:05:32.908857+00:00 app[web.1]: Install missing gem executables with `bundle install` 2017-04-19T14:05:32.908835+00:00 app[web.1]: bundler: command not found: puma 2017-04-19T14:05:33.048907+00:00 heroku[web.1]: State changed from starting to crashed 2017-04-19T14:05:33.031336+00:00 heroku[web.1]: Process exited with status 127 2017-04-19T14:14:41.000875+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=xxxxxxx.herokuapp.com request_id=a0dd220e-17c5-40f1-92a3-65b483b8576d fwd=" xxx.xx.xxx.xx " dyno= connect= service= status=503 bytes= protocol=https 2017-04-19T14:14:41.596031+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=xxxxxxx.herokuapp.com request_id=2100e41d-dab4-4677-8d71-a7248bbde791 fwd=" xxx.xx.xxx.xx " dyno= connect= service= status=503 bytes= protocol=https 2017-04-19T14:50:22.902551+00:00 heroku[web.1]: State changed from crashed to starting 2017-04-19T14:50:28.528956+00:00 heroku[web.1]: Starting process with command `bundle exec puma -C config/puma.rb` 2017-04-19T14:50:30.306320+00:00 heroku[web.1]: Process exited with status 127 2017-04-19T14:50:30.232313+00:00 app[web.1]: bundler: command not found: puma 2017-04-19T14:50:30.232329+00:00 app[web.1]: Install missing gem executables with `bundle install` 2017-04-19T14:50:30.326285+00:00 heroku[web.1]: State changed from starting to crashed 2017-04-19T16:15:40.234211+00:00 heroku[web.1]: State changed from crashed to starting 2017-04-19T16:15:45.817911+00:00 heroku[web.1]: Starting process with command `bundle exec puma -C config/puma.rb` 2017-04-19T16:15:47.840283+00:00 app[web.1]: bundler: command not found: puma 2017-04-19T16:15:47.840315+00:00 app[web.1]: Install missing gem executables with `bundle install` 2017-04-19T16:15:47.916464+00:00 heroku[web.1]: Process exited with status 127 2017-04-19T16:15:47.910091+00:00 heroku[web.1]: State changed from starting to crashed 2017-04-19T18:15:16.831776+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=xxxxxxx.herokuapp.com request_id=391fac77-dc33-4e94-96f6-5e22d89488e5 fwd="xxx.xxx.xxx.xx" dyno= connect= service= status=503 bytes= protocol=https 2017-04-19T18:15:17.874983+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=xxxxxx.herokuapp.com request_id=9d501351-960b-430c-819e-596723317658 fwd="xxx.xxx.xxx.xx" dyno= connect= service= status=503 bytes= protocol=https 2017-04-19T18:58:33.895044+00:00 heroku[web.1]: State changed from crashed to starting 2017-04-19T18:58:39.215545+00:00 heroku[web.1]: Starting process with command `bundle exec puma -C config/puma.rb` 2017-04-19T18:58:41.657221+00:00 app[web.1]: bundler: command not found: puma 2017-04-19T18:58:41.657238+00:00 app[web.1]: Install missing gem executables with `bundle install` 2017-04-19T18:58:41.811735+00:00 heroku[web.1]: Process exited with status 127 2017-04-19T18:58:41.828684+00:00 heroku[web.1]: State changed from starting to crashed ◆build logの中のwarningは以下が出ております ###### WARNING: Removing `vendor/bundle`. Checking in `vendor/bundle` is not supported. Please remove this directory and add it to your .gitignore. To vendor your gems with Bundler, use `bundle pack` instead.

###試したこと
$bundle install --path vendor/bundleにてvendor/bundleを作成 → vendor/bundle実行済みですが、
特には変わらず解決しませんでした。

■>goufさんへの追記
デプロイは以下情報もとに実行しました。
http://tanahiro.hatenablog.com/entry/2016/02/19/184142

※あとは、heroku上でのgithubとの連携も設定しております

>goufさんへの追記2
はい。インストール・認証もできております

>tbn.shさんへの追記
build logを確認したところ、warningが3つ出ていました。
2つは自力で消せたのですが、以下の対応方法がわからず解決できていません。もしお分かりになれば<m(__)m>
※エラーログもlogs -tにて取得しなおしたので、追加しました。

WARNING:
Removing `vendor/bundle`. Checking in `vendor/bundle` is not supported. Please remove this directory and add it to your .gitignore. To vendor your gems with Bundler, use `bundle pack` instead.

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

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

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

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

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

gouf

2017/04/16 19:20

どの情報を参照してデプロイを実施されましたか
gouf

2017/04/16 20:45

Heroku Toolbelt のインストール・認証はすでに終えていますか
tbn.sh

2017/04/19 04:37

ログの先頭が欠けているようなので、『heroku logs -t』で継続的にログを採りながら、別ターミナルでリスタートしてログを取り直せますか?あと、git pushのデプロイ自体でエラーは発生していませんか?
guest

回答2

0

ベストアンサー

起動時のエラーログとしては『bundler: command not found: puma』の部分がunicornに変わっていますか?

gemのインストールが出来ていて、Procfileも適切に設定されていて、それでもコマンドが見つからないとなると、申し訳ないですがすぐに思いつく原因は心当たりがないです。

投稿2017/04/21 03:25

tbn.sh

総合スコア173

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

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

hata11

2017/04/21 09:03 編集

確認したところ、pumaのままになっていました。 2017-04-19T13:33:22.722671+00:00 heroku[web.1]: Starting process with command `bundle exec puma -C config/puma.rb` 2017-04-19T13:33:25.005327+00:00 heroku[web.1]: Process exited with status 127 2017-04-19T13:33:24.927978+00:00 app[web.1]: bundler: command not found: puma github上で確認すると、Procfileは以下文の通りのunicornに書き換わっているのと、 #config/puma.rbのファイルも削除できているように見えるのですが…、どこかに残ってしまっているのでしょうか? web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb
tbn.sh

2017/04/21 09:08

だとすると、Procfileが適切に設定されていないか更新されていない、あるいはデプロイされていない、という可能性がありそうですね。 heroku run bash これでテンポラリのdynoを起動してみて、プロンプトから… cat Procfile で、実際にデプロイされているProcfileの中身が意図したもの(unicornを指定しているか?)かを確認できます。(テンポラリのdynoも起動時間は消費するので使用後は速やかにログアウトすることをオススメします) もし意図した内容でないなら、herokuにgit pushしている部分や、push元が間違いなく更新されているか等が確認ポイントになるかと思います。 あと、スマホから回答を書いていたので気がつかずに別の回答にしてしまい申し訳ないです。
hata11

2017/04/22 09:49

ありがとうございます!! 上記確認したところ、pumaの表出は消せました。 ただ、以下の文が出てきてしまったので、別スレッド立てようかと思います。 bundler: failed to load command: unicorn (/app/vendor/bundle/ruby/2.3.0/bin/unicorn) おかげさまでエラー対応、進みました。本当にありがとうございました!!
guest

0

エラー原因としては以下でしょうかね。

2017-04-19T13:33:14.958238+00:00 heroku[web.1]: Starting process with command `bundle exec puma -C config/puma.rb` 2017-04-19T13:33:17.093245+00:00 app[web.1]: bundler: command not found: puma 2017-04-19T13:33:17.093264+00:00 app[web.1]: Install missing gem executables with `bundle install` 2017-04-19T13:33:17.202130+00:00 heroku[web.1]: Process exited with status 127

Procfileには恐らくPumaの起動コマンドを登録していると思われますが、WebサーバーとしてPumaを利用していますか?また、Gemfileでproduction環境にPumaをインストールするようになっていますか?

もしUnicornをWebサーバーとして利用するのなら、Procfileの起動コマンドをUnicornに変更する必要があります。

投稿2017/04/20 14:52

tbn.sh

総合スコア173

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

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

hata11

2017/04/20 19:19

ありがとうございます!! この以下ページに書いてある通りにunicornに設定し、puma.rbファイルの削除とGemfileからgem 'puma'部分を削除してみたのですが、ご指摘いただいたエラーメッセージがまだ出続けています https://ackintosh.github.io/blog/2012/08/28/using-the-unicorn-in-heroku/ 何か解決心当たりありますでしょうか
tbn.sh

2017/04/20 21:38

unicornが見つからない、というエラーに変わっただけという感じでしょうかね。 ちなみにherokuにgit pushした時の画面出力にpumaやunicornのgemをインストールしている部分はありますか?
hata11

2017/04/21 02:15

ご確認頂き、ありがとうございます! build log確認したところ…、  ・pumaに関するものは出てきていませんでした  ・unicornに関しては以下が出ていました running `gem install bundler`. Fetching gem metadata from https://rubygems.org/.......... Fetching version metadata from https://rubygems.org/.. Fetching dependency metadata from https://rubygems.org/. ↑の下部分に↓が出ていました Using unicorn 5.3.0
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問