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

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

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

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

Ruby on Rails

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

Q&A

解決済

2回答

816閲覧

git push heroku masterができない

YugoTokonami

総合スコア21

Heroku

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

Ruby on Rails

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

0グッド

0クリップ

投稿2021/08/27 10:16

git push heroku masterでエラーが起こり、成功しません。

オリジナルアプリを作成し、本番環境へデプロイしようとし、「git push heroku master」をしたのでが、エラーが起こり、できません。色々調べたのですが、本当にわからず、
・何が原因か
・どのようにすればこのエラーが解決できるか
が全くわかりません。
教えていただけると幸いです。

ターミナルのエラー

Bundler version 2.1.4 yukahayuusatoru@TokonamugonoAir b_blog % git push heroku master Enumerating objects: 64, done. Counting objects: 100% (64/64), done. Delta compression using up to 8 threads Compressing objects: 100% (50/50), done. Writing objects: 100% (51/51), 5.51 KiB | 1.10 MiB/s, done. Total 51 (delta 35), reused 0 (delta 0), pack-reused 0 remote: Compressing source files... done. remote: Building source: remote: remote: -----> Building on the Heroku-18 stack remote: -----> Using buildpack: heroku/ruby remote: -----> Ruby app detected remote: -----> Installing bundler 2.2.21 remote: -----> Removing BUNDLED WITH version in the Gemfile.lock remote: -----> Compiling Ruby/Rails remote: -----> Using Ruby version: ruby-2.6.5 remote: -----> Installing dependencies using bundler 2.2.21 remote: Running: BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin BUNDLE_DEPLOYMENT=1 bundle install -j4 remote: Unable to find a spec satisfying -listen (~> 4.0.0) in the set. Perhaps the remote: lockfile is corrupted? remote: Bundler Output: Unable to find a spec satisfying -listen (~> 4.0.0) in the set. Perhaps the remote: lockfile is corrupted? remote: remote: ! remote: ! Failed to install gems via Bundler. remote: ! remote: ! Push rejected, failed to compile Ruby app. remote: remote: ! Push failed remote: ! remote: ! ## Warning - The same version of this code has already been built: 278573df2e29d306e5603b6427f69226b8737a5a remote: ! remote: ! We have detected that you have triggered a build from source code with version 278573df2e29d306e5603b6427f69226b8737a5a remote: ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch. remote: ! remote: ! If you are developing on a branch and deploying via git you must run: remote: ! remote: ! git push heroku <branchname>:main remote: ! remote: ! This article goes into details on the behavior: remote: ! https://devcenter.heroku.com/articles/duplicate-build-version remote: remote: Verifying deploy... remote: remote: ! Push rejected to b-blog-36388. remote: To https://git.heroku.com/b-blog-36388.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/b-blog-36388.git'

heroku logsのメッセージ

2021-08-27T02:16:55.474328+00:00 heroku[web.1]: Idling 2021-08-27T02:16:55.484441+00:00 heroku[web.1]: State changed from up to down 2021-08-27T02:16:56.512053+00:00 heroku[web.1]: Stopping all processes with SIGTERM 2021-08-27T02:16:56.673025+00:00 app[web.1]: - Gracefully stopping, waiting for requests to finish 2021-08-27T02:16:56.673485+00:00 app[web.1]: === puma shutdown: 2021-08-27 02:16:56 +0000 === 2021-08-27T02:16:56.673488+00:00 app[web.1]: - Goodbye! 2021-08-27T02:16:56.673560+00:00 app[web.1]: Exiting 2021-08-27T02:16:56.774015+00:00 heroku[web.1]: Process exited with status 143 2021-08-27T08:07:41.317770+00:00 app[api]: Starting process with command `rails db:migrate` by user 2021-08-27T08:07:50.738703+00:00 heroku[run.5863]: State changed from starting to up 2021-08-27T08:07:50.820181+00:00 heroku[run.5863]: Awaiting client 2021-08-27T08:07:50.845681+00:00 heroku[run.5863]: Starting process with command `rails db:migrate` 2021-08-27T08:07:59.585295+00:00 heroku[run.5863]: Process exited with status 0 2021-08-27T08:07:59.647410+00:00 heroku[run.5863]: State changed from up to complete 2021-08-27T08:08:06.000000+00:00 app[api]: Build started by user 2021-08-27T08:08:51.000000+00:00 app[api]: Build failed -- check your build output: https://dashboard.heroku.com/apps/f3d6a5f1-8229-48f1-8788-72ec530c70f4/activity/builds/ae295877-7fe3-4afe-8da2-2a37702f33b0 2021-08-27T08:09:33.000000+00:00 app[api]: Build started by user 2021-08-27T08:10:17.000000+00:00 app[api]: Build failed -- check your build output: https://dashboard.heroku.com/apps/f3d6a5f1-8229-48f1-8788-72ec530c70f4/activity/builds/70cd4745-70d2-4419-9899-40887d3ea3b1 2021-08-27T08:13:28.970773+00:00 app[api]: Starting process with command `rails db:migrate` by user 2021-08-27T08:13:35.224456+00:00 heroku[run.9794]: Awaiting client 2021-08-27T08:13:35.244761+00:00 heroku[run.9794]: Starting process with command `rails db:migrate` 2021-08-27T08:13:35.370656+00:00 heroku[run.9794]: State changed from starting to up 2021-08-27T08:13:43.753918+00:00 heroku[run.9794]: Process exited with status 0 2021-08-27T08:13:43.926963+00:00 heroku[run.9794]: State changed from up to complete 2021-08-27T08:13:50.000000+00:00 app[api]: Build started by user 2021-08-27T08:14:39.000000+00:00 app[api]: Build failed -- check your build output: https://dashboard.heroku.com/apps/f3d6a5f1-8229-48f1-8788-72ec530c70f4/activity/builds/8e57cc65-f0f4-43ad-b68c-ea0b56ffb1bf 2021-08-27T08:49:08.000000+00:00 app[api]: Build started by user 2021-08-27T08:49:55.000000+00:00 app[api]: Build failed -- check your build output: https://dashboard.heroku.com/apps/f3d6a5f1-8229-48f1-8788-72ec530c70f4/activity/builds/748538c9-0141-489c-94bc-b3344f646e4e 2021-08-27T08:50:42.000000+00:00 app[api]: Build started by user 2021-08-27T08:51:26.000000+00:00 app[api]: Build failed -- check your build output: https://dashboard.heroku.com/apps/f3d6a5f1-8229-48f1-8788-72ec530c70f4/activity/builds/9770a9f7-5406-40fc-9094-9941b0f1a517 2021-08-27T08:53:14.000000+00:00 app[api]: Build started by user 2021-08-27T08:53:59.000000+00:00 app[api]: Build failed -- check your build output: https://dashboard.heroku.com/apps/f3d6a5f1-8229-48f1-8788-72ec530c70f4/activity/builds/75a6a65f-7055-4b46-b77e-3948de11057a 2021-08-27T08:55:25.000000+00:00 app[api]: Build started by user 2021-08-27T08:56:13.000000+00:00 app[api]: Build failed -- check your build output: https://dashboard.heroku.com/apps/f3d6a5f1-8229-48f1-8788-72ec530c70f4/activity/builds/02f3eeb1-4789-4649-9b11-4f9aab999788 2021-08-27T09:05:33.000000+00:00 app[api]: Build started by user 2021-08-27T09:06:18.000000+00:00 app[api]: Build failed -- check your build output: https://dashboard.heroku.com/apps/f3d6a5f1-8229-48f1-8788-72ec530c70f4/activity/builds/ae97f36d-f5e8-4df8-8a72-c22310c08429 2021-08-27T09:07:29.000000+00:00 app[api]: Build started by user 2021-08-27T09:08:19.000000+00:00 app[api]: Build failed -- check your build output: https://dashboard.heroku.com/apps/f3d6a5f1-8229-48f1-8788-72ec530c70f4/activity/builds/e78cffd9-a449-4bdd-85ef-1fc1302cea80 2021-08-27T09:33:13.000000+00:00 app[api]: Build started by user 2021-08-27T09:34:06.000000+00:00 app[api]: Build failed -- check your build output: https://dashboard.heroku.com/apps/f3d6a5f1-8229-48f1-8788-72ec530c70f4/activity/builds/967e5fe7-34e8-459a-81e9-3a20562d2c9b 2021-08-27T09:41:35.000000+00:00 app[api]: Build started by user 2021-08-27T09:41:41.000000+00:00 app[api]: Build failed -- check your build output: https://dashboard.heroku.com/apps/f3d6a5f1-8229-48f1-8788-72ec530c70f4/activity/builds/c50eeddd-c019-498a-b9b3-25f3884220bc 2021-08-27T09:54:37.000000+00:00 app[api]: Build started by user 2021-08-27T09:54:42.000000+00:00 app[api]: Build failed -- check your build output: https://dashboard.heroku.com/apps/f3d6a5f1-8229-48f1-8788-72ec530c70f4/activity/builds/fb8fa6fb-5876-4bb9-8ce3-bf07f7194319 2021-08-27T09:59:36.000000+00:00 app[api]: Build started by user 2021-08-27T09:59:42.000000+00:00 app[api]: Build failed -- check your build output: https://dashboard.heroku.com/apps/f3d6a5f1-8229-48f1-8788-72ec530c70f4/activity/builds/c2c47823-d65c-4ae9-a2f7-6c976fe88293

メールアドレスが表示されていた部分は消しています。

試したこと

調べたら「リモートリポジトリとローカリリポジトリのバージョン?あっていない」のようなサイトもあったのですが、多分そこが間違いではないとも思うのですが、原因が本当にわかりません。

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

Bundler version 2.1.4

少しコードが長いですが、エラーを解決していただけると幸いです。

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

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

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

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

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

hoshi-takanori

2021/08/27 11:16

-listen という名前の gem が見当たらないようですが、名前が - で始まる gem はないと思うので、Gemfile か Gemfile.lock がおかしくなってるのでは。
YugoTokonami

2021/08/27 11:33

回答してくださってありがとうございます! 調べてみたところ、Gemfile.lockに「-listen (~> 4.0.0)」という記述がありました。 この記述を削除すればエラーは解決するということなのでしょうか?
hoshi-takanori

2021/08/27 12:58

通常 Gemfile.lock は自分でいじるものではないと思いますが、Ruby 詳しくないのでよく分かりません。
YugoTokonami

2021/08/27 13:06

わかりました! Gemfileはいじらないでおきます!
guest

回答2

0

自己解決

こちらの質問は解決したので、
一旦閉じます!
ありがとうございます。

投稿2021/08/29 06:57

YugoTokonami

総合スコア21

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

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

0

herokuではbundler 2.2.21を使ってるとログに書いてありますので、バージョンを揃えてみて試してみてはいかがでしょうか^^

「Failed to install gems via Bundler」 で検索すると参考になる記事が出てくるかもです^^
ex) https://yumishin.com/heroku-push-error/

投稿2021/08/27 17:00

kawa_kawawaka

総合スコア71

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

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

YugoTokonami

2021/08/28 03:10

回答ありがとうございます!記事を参考にして、バージョンを同じにした状態でgit push heroku masterを行ったのですが、エラーは解決しませんでした...
kawa_kawawaka

2021/08/28 03:57

あれそうでしたか、すみません>< たぶんbundlerかgemfileが怪しいかなと思いましたので、gemfile中身を記載すると他の方も答えやすいかもしれないです^^ あと確認ですが、bundlerのバージョン変更前後ともに、ローカルでのgemのインストールは成功していますでしょうか??
YugoTokonami

2021/08/28 05:14

わかりました!Gemfileは追加します。しかし、文字数が上限を超えていて、この質問にGemfileを追加で添付することができないので、新しく質問をします。 あと、ローカルでのgemのインストールとはなんでしょうか?ターミナルで、できるのでしょうか? 先程いただいた参考の記事に書いてある方法をそのまま(bundlerのバージョンは変えた)ターミナルに入力しましたが、それとは別に何かしなければならないことがあるのでしょうか?
kawa_kawawaka

2021/08/28 16:51

gemのインストールは`bundle install`のことです。新しい質問見る限りやっていると思うので、気にしないでください><
kawa_kawawaka

2021/08/29 04:35

こちらは、自分の回答で一旦解決してると思うので閉じてくださいー^^
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.46%

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

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

質問する

関連した質問