Skip to content

Commit

Permalink
Bundler-2.4 requires Ruby 2.6 or later.
Browse files Browse the repository at this point in the history
  • Loading branch information
hsbt authored and eregon committed Dec 24, 2022
1 parent 4b2d1d6 commit 8d6236c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bundler.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,17 @@ export async function installBundler(bundlerVersionInput, rubygemsInputSet, lock
}

// Use Bundler 1 when we know Bundler 2 does not work
// Use Bundler 2.3 when we use Ruby 2.3.2-2.5
if (bundlerVersion.startsWith('2')) {
if (engine === 'ruby' && floatVersion <= 2.2) {
console.log('Bundler 2 requires Ruby 2.3+, using Bundler 1 on Ruby <= 2.2')
bundlerVersion = '1'
} else if (engine === 'ruby' && /^2\.3\.[01]/.test(rubyVersion)) {
console.log('Ruby 2.3.0 and 2.3.1 have shipped with an old rubygems that only works with Bundler 1')
bundlerVersion = '1'
} else if (engine === 'ruby' && floatVersion <= 2.5) {
console.log('Ruby 2.3.2-2.5 only works with Bundler 2.3')
bundlerVersion = '2.3'
} else if (engine === 'jruby' && rubyVersion.startsWith('9.1')) { // JRuby 9.1 targets Ruby 2.3, treat it the same
console.log('JRuby 9.1 has a bug with Bundler 2 (https://github.com/ruby/setup-ruby/issues/108), using Bundler 1 instead on JRuby 9.1')
bundlerVersion = '1'
Expand Down
4 changes: 4 additions & 0 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8d6236c

Please sign in to comment.