From 1c896c8ea1f8463e86e9975e8e705e6204c78021 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Thu, 12 Nov 2020 19:08:18 +0100 Subject: [PATCH] Always use Bundler 1 for JRuby 9.1.x --- dist/index.js | 7 +++++-- index.js | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/dist/index.js b/dist/index.js index 5a4cf22..dfb9435 100644 --- a/dist/index.js +++ b/dist/index.js @@ -51367,12 +51367,15 @@ async function installBundler(bundlerVersionInput, lockFile, platform, rubyPrefi throw new Error(`Cannot parse bundler input: ${bundlerVersion}`) } - if (rubyVersion.match(/^2\.[12]/)) { + if (engine === 'ruby' && rubyVersion.match(/^2\.[12]/)) { console.log('Bundler 2 requires Ruby 2.3+, using Bundler 1 on Ruby <= 2.2') bundlerVersion = '1' - } else if (rubyVersion.startsWith('2.3')) { + } else if (engine === 'ruby' && rubyVersion.startsWith('2.3')) { 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') bundlerVersion = '1' + } 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' } if ((engine === 'ruby' || engine === 'truffleruby') && common.isHeadVersion(rubyVersion) && bundlerVersion === '2') { diff --git a/index.js b/index.js index ab499f8..2b0877f 100644 --- a/index.js +++ b/index.js @@ -215,12 +215,15 @@ async function installBundler(bundlerVersionInput, lockFile, platform, rubyPrefi throw new Error(`Cannot parse bundler input: ${bundlerVersion}`) } - if (rubyVersion.match(/^2\.[12]/)) { + if (engine === 'ruby' && rubyVersion.match(/^2\.[12]/)) { console.log('Bundler 2 requires Ruby 2.3+, using Bundler 1 on Ruby <= 2.2') bundlerVersion = '1' - } else if (rubyVersion.startsWith('2.3')) { + } else if (engine === 'ruby' && rubyVersion.startsWith('2.3')) { 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') bundlerVersion = '1' + } 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' } if ((engine === 'ruby' || engine === 'truffleruby') && common.isHeadVersion(rubyVersion) && bundlerVersion === '2') {