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

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

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

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

GitHub

GitHubは、Gitバージョン管理システムを利用したソフトウェア開発向けの共有ウェブサービスです。GitHub商用プランおよびオープンソースプロジェクト向けの無料アカウントを提供しています。

Ruby on Rails

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

Q&A

解決済

1回答

1323閲覧

herokuでデプロイしようとしたらFailed to install gems via Bundlerと出る。

mari_

総合スコア2

Heroku

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

GitHub

GitHubは、Gitバージョン管理システムを利用したソフトウェア開発向けの共有ウェブサービスです。GitHub商用プランおよびオープンソースプロジェクト向けの無料アカウントを提供しています。

Ruby on Rails

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

0グッド

0クリップ

投稿2021/09/05 07:28

herokuでデプロイしようとしたのですが、Failed to install gems via Bundlerと出ます。

 色々調べ、bundlerのバージョンが合ってないのではと思い、バージョンを変更したりしましたが、ずっと同じエラーです。

Run bundle install elsewhere and add the updated Gemfile.lock to version control.

とあるので、bundle installをし、updateもしました。

 gitでコミット・プッシュできていないのではと思い、コミット・プッシュもしましたが、解決しません。

 データベースはPostgreSQLに設定してあります。

 アプリのurlを入力すると、Welcome to your new app!と表示さる状態です。

 他に考えられる原因等あれば、ご教授ください。

git

1Enumerating objects: 781, done. 2Counting objects: 100% (781/781), done. 3Compressing objects: 100% (736/736), done. 4Writing objects: 100% (781/781), 17.00 MiB | 14.37 MiB/s, done. 5Total 781 (delta 429), reused 0 (delta 0) 6remote: Compressing source files... done. 7remote: Building source: 8remote: 9remote: -----> Building on the Heroku-18 stack 10remote: -----> Determining which buildpack to use for this app 11remote: ! Warning: Multiple default buildpacks reported the ability to handle this app. The first buildpack in the list below will be used. 12remote: Detected buildpacks: Ruby,Node.js 13remote: See https://devcenter.heroku.com/articles/buildpacks#buildpack-detect-order 14remote: -----> Ruby app detected 15remote: -----> Installing bundler 1.17.3 16remote: -----> Removing BUNDLED WITH version in the Gemfile.lock 17remote: -----> Compiling Ruby/Rails 18remote: -----> Using Ruby version: ruby-2.5.3 19remote: -----> Installing dependencies using bundler 1.17.3 20remote: Running: BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin BUNDLE_DEPLOYMENT=1 BUNDLE_GLOBAL_PATH_APPENDS_RUBY_SCOPE=1 bundle install -j4 21remote: You are trying to install in deployment mode after changing 22remote: your Gemfile. Run `bundle install` elsewhere and add the 23remote: updated Gemfile.lock to version control. 24remote: 25remote: If this is a development machine, remove the /tmp/build_18756f12/Gemfile freeze 26remote: by running `bundle install --no-deployment`. 27remote: 28remote: You have deleted from the Gemfile: 29remote: * pry-byebug 30remote: * pry-doc 31remote: * pry-rails 32remote: Bundler Output: You are trying to install in deployment mode after changing 33remote: your Gemfile. Run `bundle install` elsewhere and add the 34remote: updated Gemfile.lock to version control. 35remote: 36remote: If this is a development machine, remove the /tmp/build_18756f12/Gemfile freeze 37remote: by running `bundle install --no-deployment`. 38remote: 39remote: You have deleted from the Gemfile: 40remote: * pry-byebug 41remote: * pry-doc 42remote: * pry-rails 43remote: 44remote: ! 45remote: ! Failed to install gems via Bundler. 46remote: ! 47remote: ! Push rejected, failed to compile Ruby app. 48remote: 49remote: ! Push failed 50remote: ! 51remote: ! ## Warning - The same version of this code has already been built: 18d6a6f1ad11144a86a1686ddb07289219856d21 52remote: ! 53remote: ! We have detected that you have triggered a build from source code with version 18d6a6f1ad11144a86a1686ddb07289219856d21 54remote: ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch. 55remote: ! 56remote: ! If you are developing on a branch and deploying via git you must run: 57remote: ! 58remote: ! git push heroku <branchname>:main 59remote: ! 60remote: ! This article goes into details on the behavior: 61remote: ! https://devcenter.heroku.com/articles/duplicate-build-version 62remote: 63remote: Verifying deploy... 64remote: 65remote: ! Push rejected to fingout. 66remote: 67 ! [remote rejected] main -> main (pre-receive hook declined)

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

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

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

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

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

guest

回答1

0

自己解決

gitのディレクトリ構造に問題があり、別のGemfile.とGemfile.lockがherokuに参照されていました。
gitに新しいリポジトリを作ってデプロイすると、解決しました!

投稿2021/09/13 03:47

mari_

総合スコア2

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

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

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.46%

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

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

質問する

関連した質問