Skip to content

Commit 1c896c8

Browse files
committed
Always use Bundler 1 for JRuby 9.1.x
1 parent ba761ba commit 1c896c8

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

dist/index.js

Lines changed: 5 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,12 +215,15 @@ async function installBundler(bundlerVersionInput, lockFile, platform, rubyPrefi
215215
throw new Error(`Cannot parse bundler input: ${bundlerVersion}`)
216216
}
217217

218-
if (rubyVersion.match(/^2\.[12]/)) {
218+
if (engine === 'ruby' && rubyVersion.match(/^2\.[12]/)) {
219219
console.log('Bundler 2 requires Ruby 2.3+, using Bundler 1 on Ruby <= 2.2')
220220
bundlerVersion = '1'
221-
} else if (rubyVersion.startsWith('2.3')) {
221+
} else if (engine === 'ruby' && rubyVersion.startsWith('2.3')) {
222222
console.log('Ruby 2.3 has a bug with Bundler 2 (https://github.com/rubygems/rubygems/issues/3570), using Bundler 1 instead on Ruby 2.3')
223223
bundlerVersion = '1'
224+
} else if (engine === 'jruby' && rubyVersion.startsWith('9.1.')) { // JRuby 9.1 targets Ruby 2.3, treat it the same
225+
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')
226+
bundlerVersion = '1'
224227
}
225228

226229
if ((engine === 'ruby' || engine === 'truffleruby') && common.isHeadVersion(rubyVersion) && bundlerVersion === '2') {

0 commit comments

Comments
 (0)