LoginSignup
0
0

More than 3 years have passed since last update.

【heroku】デプロイ時のbundler (LoadError)エラー

Posted at

herokuへのデプロイを試みた際にbundlerに関連したエラーを経験したので、解決策を載せておきます。

bundler (LoadError)

このエラーはherokuが対応しているbundlerと、アプリ内のbundlerのバージョンが違うことに起因するものでした。
現時点で、herokuは2.1.4までのバージョンのみ対応しているらしく、それ以降のバージョンはエラーになってしまいます。
ということで、アプリディレクトリに移動しGemfile.lockを確認。アプリには以下の記述のバージョンのbundlerが適用されています。

Gemfile.lock
BUNDLED WITH
   2.*.*

Gemfile.lockはgemの関係性を保つためのファイルで、bundle install時に自動で作成されます。よって、このファイルを削除してから、バージョン2.1.4のbundlerをインストールし、bundle installを実行します。

$ rm Gemfile.lock 
$ gem install bundler -v 2.1.4
$ bundle _2.1.4_ install without production

この方法で、デプロイに成功しました。

参考

cannot load such file -- rake (LoadError)やcannot load such file -- bootsnap/setup (LoadError)と出てherokuへのデプロイに失敗する

0
0
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
0
0