heroku/base-images

With `heroku/heroku:18`, `gem install bundler` fails

Closed this issue · 2 comments

With the release of bundler version 2, it started to fail.

% docker run -it heroku/heroku:18
root@xxxxxxxxxxxx:/# gem install bundler
Fetching: bundler-2.0.0.gem (100%)
ERROR:  Error installing bundler:
        The last version of bundler (>= 0) to support your Ruby & RubyGems was 1.17.3. Try installing it with `gem install bundler -v 1.17.3`
        bundler requires RubyGems version >= 3.0.0. The current RubyGems version is 2.7.6. Try 'gem update --system' to update RubyGems itself.

I can just do as the error message says, but just let you folks know.

tt commented

I think you'll have to use an older Bundler version.

Ruby is available in our stack image for scripting purposes. The one available, version 2.5.1 (see our Ubuntu Packages article), is the one Canonical provides for Ubuntu 18.04. They're unlikely to upgrade either Ruby, any gems or other packages to backwards incompatible versions because that's a change in contract for everyone using that distribution. The same applies on Heroku; if we patch these, we risk taking down running apps.

However, if you use Ruby on Heroku, the buildpack will install your desired Ruby version separately along with a compatible Bundler version. This is to give you full control over which runtime you use and to decouple that from stack image upgrades (so you in a couple years can upgrade to Heroku-20 without also having to change your app to the Ruby version that happens to be included with Ubuntu 20.04).

Can you explain your use case?

I went with gem install bundler -v 1.17.3 path.

I figured out why and how this happened immediately, so it was not a problem to me, but the code used to work suddenly stopped working was a bit of surprise to me. I assume this happens to some other folks too, so I decided to post it here. Thanks for your explanation.