1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

HerokuへPushする際に「Failed to install gems via Bundler.」エラーが発生

Posted at

をやっている時に「Heroku push」でつまづいたのでメモ。
スクリーンショット 2021-01-31 18.54.42.png

https://qiita.com/JFCheval/items/91ba766b63878ff80d23
こちらを試しましたが、エラーがなおらず、、

エラーを見るとHerokuのBundlerのバージョンが2.1.4だったのでローカルのバージョンも合わせてみることに。

バージョンの下げ方はこちらを参照しました↓
https://yumishin.com/heroku-push-error/

$ gem uninstall bundler #ローカルのbundlerをアンインストール
Gem bundler-2.2.3 cannot be uninstalled because it is a default gem

$ gem install bundler --version '2.1.4' #Herokuと同じversionのbundlerをローカルにインストール
Fetching bundler-2.1.4.gem/Successfully installed bundler-2.1.4
Parsing documentation for bundler-2.1.4
Installing ri documentation for bundler-2.1.4
Done installing documentation for bundler after 5 seconds
1 gem installed

$ bundler -v #bundlerのバージョンを確認、何故か変わりません。
Bundler version 2.2.3

$ gem list bundler #ローカルにインストールされているbundlerのversionリストを表示
bundler (default: 2.2.3, 2.1.4)

$ rm Gemfile.lock #ローカルに入っているbundler(2.2.3)を削除しbundler(2.1.4)で作り直す。

$ bundle _2.1.4_ install
Warning: the running version of Bundler (2.1.4) is older than the version that created the lockfile (2.2.3). We suggest you to upgrade to the version that created the lockfile by running `gem install bundler:2.2.3`.
The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for x86_64-darwin-20, ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`.
以下割愛

$ bundle _2.1.4_ install --without production

$ git add . 
$ git commit -m 'aaa'
$ git push heroku master
$ heroku open

でうまくいきました。ご参考までに。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?