Skip to content

Commit

Permalink
Bundler default version now 2.3.x
Browse files Browse the repository at this point in the history
Bundler 1.x is not able to run with Ruby 3.3 in some circumstances:

```
       remote:  !     There was an error parsing your Gemfile, we cannot continue        
       remote:  !     /tmp/d20250127-138-l8vq2r/bundler-1.17.3/gems/bundler-1.17.3/lib/bundler/shared_helpers.rb:29:in `root': undefined method `untaint' for an instance of Pathname (NoMethodError)        
       remote:  !             
       remote:  !     Pathname.new(gemfile).untaint.expand_path.parent  
```

This commit updates the default bundler version to 2.3.x.
schneems committed Jan 30, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 43f05b6 commit e2b20cb
Showing 3 changed files with 19 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@
## [Unreleased]

- Default Ruby version is now 3.3.7 (https://github.com/heroku/heroku-buildpack-ruby/pull/1534)
- Default bundler version (when no version present in the `Gemfile.lock`) is now bundler `2.3.x` which is currently `2.3.25` (https://github.com/heroku/heroku-buildpack-ruby/pull/1534)

## [v288] - 2025-01-06

13 changes: 13 additions & 0 deletions changelogs/unreleased/bundler_default.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## Ruby applications with no specified bundler versions now receive Bundler 2.x

Previously applications with no `BUNDLED WITH` in their `Gemfile.lock` would receive bundler `1.x`. They will now receive the new [default bundler version](https://devcenter.heroku.com/articles/ruby-support-reference#default-bundler-version) `2.3.x`.

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.
6 changes: 5 additions & 1 deletion lib/language_pack/helpers/bundler_wrapper.rb
Original file line number Diff line number Diff line change
@@ -42,6 +42,10 @@ class LanguagePack::Helpers::BundlerWrapper
BLESSED_BUNDLER_VERSIONS["2.4"] = "2.4.22"
BLESSED_BUNDLER_VERSIONS["2.5"] = "2.5.23"
BLESSED_BUNDLER_VERSIONS["2.6"] = "2.6.2"

DEFAULT_VERSION = BLESSED_BUNDLER_VERSIONS["2.3"]

# Convert arbitrary `<Major>.<Minor>.x` versions
BLESSED_BUNDLER_VERSIONS.default_proc = Proc.new do |hash, key|
if Gem::Version.new(key).segments.first == 1
hash["1"]
@@ -65,7 +69,7 @@ def self.detect_bundler_version(contents: )
minor = version_match[:minor]
BLESSED_BUNDLER_VERSIONS["#{major}.#{minor}"]
else
BLESSED_BUNDLER_VERSIONS["1"]
DEFAULT_VERSION
end
end

0 comments on commit e2b20cb

Please sign in to comment.