LoginSignup
7
5

More than 5 years have passed since last update.

railsアプリをHerokuにpushするときにエラー("You must use Bundler 2 or greater with this lockfile.")

Last updated at Posted at 2019-01-20

MacOS
rails 5.1.6

herokuにpushすると以下のエラーが出る。

$ git push heroku master
Total 0 (delta 0), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Ruby app detected
remote:
remote:  !
remote:  !     You must use Bundler 2 or greater with this lockfile.
remote:  !
~省略~
remote:  !     Push rejected, failed to compile Ruby app.
remote:
remote:  !     Push failed
remote: Verifying deploy...
remote:
remote: !       Push rejected to ***.
remote:
To https://git.heroku.com/***.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/***.git'

"You must use Bundler 2 or greater with this lockfile."
はどうすればいいんじゃ?と調べた結果、
以下コマンドでビルドパッケージを追加

$ heroku buildpacks:set https://github.com/bundler/heroku-buildpack-bundler2
Buildpack set. Next release on rails-tutorial-iwato will use https://github.com/bundler/heroku-buildpack-bundler2.
Run git push heroku master to create a new release using this buildpack.

もう一度
git push heroic master
で無事herokuにpushできた。

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