diff --git a/CHANGELOG.md b/CHANGELOG.md index 9678d7362..30eb99c36 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## [Unreleased] +- Ruby apps using bundler 2.6+ will now receive bundler 2.6.2 (https://github.com/heroku/heroku-buildpack-ruby/pull/1535) +- Ruby apps using bundler 2.5.x will now receive bundler 2.5.23 (https://github.com/heroku/heroku-buildpack-ruby/pull/1535) ## [v287] - 2024-12-25 diff --git a/changelogs/unreleased/bundler_2.5.23.md b/changelogs/unreleased/bundler_2.5.23.md new file mode 100644 index 000000000..9267483f4 --- /dev/null +++ b/changelogs/unreleased/bundler_2.5.23.md @@ -0,0 +1,15 @@ +## Bundler version 2.5.23 is now available for Ruby Applications + +The [Ruby Buildpack](https://devcenter.heroku.com/articles/ruby-support#libraries) installs a version of bundler based on the major and minor version listed in the `Gemfile.lock` under the `BUNDLED WITH` key: + +- `BUNDLED WITH` 2.5.x will receive bundler `2.5.23` + +It is strongly recommended that you have both a `RUBY VERSION` and `BUNDLED WITH` version listed in your `Gemfile.lock`. If you do not have those values, you can generate them and commit them to git: + +``` +$ bundle update --ruby +$ git add Gemfile.lock +$ git commit -m "Update Gemfile.lock" +``` + +Applications without these values specified in the `Gemfile.lock` may break unexpectedly when the defaults change. diff --git a/changelogs/unreleased/bundler_2.6.x_support.md b/changelogs/unreleased/bundler_2.6.x_support.md new file mode 100644 index 000000000..e9d131563 --- /dev/null +++ b/changelogs/unreleased/bundler_2.6.x_support.md @@ -0,0 +1,15 @@ +## Bundler version 2.6.2 is now available for Ruby Applications + +The [Ruby Buildpack](https://devcenter.heroku.com/articles/ruby-support#libraries) installs a version of bundler based on the major and minor version listed in the `Gemfile.lock` under the `BUNDLED WITH` key: + +- `BUNDLED WITH` 2.6.x and above will receive bundler `2.6.2` + +It is strongly recommended that you have both a `RUBY VERSION` and `BUNDLED WITH` version listed in your `Gemfile.lock`. If you do not have those values, you can generate them and commit them to git: + +``` +$ bundle update --ruby +$ git add Gemfile.lock +$ git commit -m "Update Gemfile.lock" +``` + +Applications without these values specified in the `Gemfile.lock` may break unexpectedly when the defaults change. diff --git a/lib/language_pack/helpers/bundler_wrapper.rb b/lib/language_pack/helpers/bundler_wrapper.rb index 93377083f..64d030cfe 100644 --- a/lib/language_pack/helpers/bundler_wrapper.rb +++ b/lib/language_pack/helpers/bundler_wrapper.rb @@ -40,13 +40,14 @@ class LanguagePack::Helpers::BundlerWrapper # Heroku-20's oldest Ruby verison is 2.5.x which doesn't work with bundler 2.4 BLESSED_BUNDLER_VERSIONS["2.3"] = "2.3.25" BLESSED_BUNDLER_VERSIONS["2.4"] = "2.4.22" - BLESSED_BUNDLER_VERSIONS["2.5"] = "2.5.6" + BLESSED_BUNDLER_VERSIONS["2.5"] = "2.5.23" + BLESSED_BUNDLER_VERSIONS["2.6"] = "2.6.2" BLESSED_BUNDLER_VERSIONS.default_proc = Proc.new do |hash, key| if Gem::Version.new(key).segments.first == 1 hash["1"] elsif Gem::Version::new(key).segments.first == 2 - if Gem::Version.new(key) > Gem::Version.new("2.5") - hash["2.5"] + if Gem::Version.new(key) > Gem::Version.new("2.6") + hash["2.6"] elsif Gem::Version.new(key) < Gem::Version.new("2.3") hash["2.3"] else diff --git a/spec/helpers/bundler_wrapper_spec.rb b/spec/helpers/bundler_wrapper_spec.rb index a1b25951c..3a7fdca33 100644 --- a/spec/helpers/bundler_wrapper_spec.rb +++ b/spec/helpers/bundler_wrapper_spec.rb @@ -36,8 +36,12 @@ expect(version).to eq(wrapper_klass::BLESSED_BUNDLER_VERSIONS["2.5"]) version = wrapper_klass.detect_bundler_version(contents: "BUNDLED WITH\n 2.6.7") - expect(wrapper_klass::BLESSED_BUNDLER_VERSIONS.key?("2.5")).to be_truthy - expect(version).to eq(wrapper_klass::BLESSED_BUNDLER_VERSIONS["2.5"]) + expect(wrapper_klass::BLESSED_BUNDLER_VERSIONS.key?("2.6")).to be_truthy + expect(version).to eq(wrapper_klass::BLESSED_BUNDLER_VERSIONS["2.6"]) + + version = wrapper_klass.detect_bundler_version(contents: "BUNDLED WITH\n 2.999.7") + expect(wrapper_klass::BLESSED_BUNDLER_VERSIONS.key?("2.6")).to be_truthy + expect(version).to eq(wrapper_klass::BLESSED_BUNDLER_VERSIONS["2.6"]) expect { wrapper_klass.detect_bundler_version(contents: "BUNDLED WITH\n 3.6.7")