Help us understand the problem. What is going on with this article?

[heroku] bundler 2.0+ をつかえるようにbuildpackをカスタムしていてpushが弾かれた話

前提

Bundler gemが2.0にアップデートされたときに、アプリケーションもそのバージョンにアップしたけれど、herokuが内部で使用しているBundlerのバージョンが1.xxだったので、Bundler 2 系を使ったアプリを Heroku にデプロイする (You must use Bundler 2 or greater with this lockfile. (Bundler::LockfileError)) - Qiitaのように、buildpackをカスタムしてheroku pushして運用していました。

(…何ヶ月か後)

問題: push heroku がリジェクトされる

そのことをすっかり忘れ、久しぶりにpush herokuすると、 bundlerがみつからないエラーがでました。

remote:  !
remote:  !     Could not detect rake tasks
remote:  !     ensure you can run `$ bundle exec rake -P` against your app
remote:  !     and using the production group of your Gemfile.
remote:  !     Activating bundler (2.0.2) failed:
remote:  !     Could not find 'bundler' (2.0.2) required by your /tmp/build_2d0783040187f94af65f0eef9a2422a9/Gemfile.lock.
remote:  !     To update to the latest version installed on your system, run `bundle update --bundler`.
remote:  !     To install the missing version, run `gem install bundler:2.0.2`
remote:  !     Checked in 'GEM_PATH=/tmp/build_2d0783040187f94af65f0eef9a2422a9/vendor/bundle/ruby/2.6.0', execute `gem env` for more information
remote:  !
remote:  !     To install the version of bundler this project requires, run `gem install bundler -v '2.0.2'`
remote:  !

そうだbuildpackをカスタムしたぞ。と気づいて現在の状態を確認します。
bundlerの公式が提供していたbuildpackをつかうようになっていました。

$ heroku buildpacks
=== your-apps Buildpack URL
https://github.com/bundler/heroku-buildpack-bundler2.git

解決:buildpacks:set でデフォルトの状態にもどす

Bundler Version | Heroku Dev Centerを参考に、buildpacksを元の状態にもどします。

$ heroku buildpacks:set heroku/ruby
Buildpack set. Next release on your-apps will use heroku/ruby.
Run git push heroku master to create a new release using this buildpack.

$ heroku buildpacks
=== your-apps Buildpack URL
heroku/ruby

このあと、push herokuが正常に動作しました。

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした