diff --git a/README.md b/README.md index aa6de24..0de3819 100644 --- a/README.md +++ b/README.md @@ -112,7 +112,7 @@ and the [condition and expression syntax](https://help.github.com/en/actions/ref By default, if there is a `Gemfile.lock` file with a `BUNDLED WITH` section, the latest version of Bundler with the same major version will be installed. -Otherwise, the latest Bundler version is installed (except for Ruby 2.2 where only Bundler 1 is supported). +Otherwise, the latest Bundler version is installed (except for Ruby 2.2 and 2.3 where only Bundler 1 is supported). This behavior can be customized, see [action.yml](action.yml) for details about the `bundler` input. diff --git a/dist/index.js b/dist/index.js index e2a1e22..d22e20a 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1127,15 +1127,20 @@ async function installBundler(platform, rubyPrefix, engine, rubyVersion) { bundlerVersion = '2' } - if (rubyVersion.startsWith('2.2')) { - console.log('Bundler 2 requires Ruby 2.3+, using Bundler 1 on Ruby 2.2') - bundlerVersion = '1' - } else if (/^\d+/.test(bundlerVersion)) { + if (/^\d+/.test(bundlerVersion)) { // OK } else { throw new Error(`Cannot parse bundler input: ${bundlerVersion}`) } + if (rubyVersion.startsWith('2.2')) { + console.log('Bundler 2 requires Ruby 2.3+, using Bundler 1 on Ruby 2.2') + bundlerVersion = '1' + } else if (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' + } + if (engine === 'ruby' && common.isHeadVersion(rubyVersion) && bundlerVersion === '2') { console.log(`Using Bundler 2 shipped with ${engine}-${rubyVersion}`) } else if (engine === 'truffleruby' && bundlerVersion === '1') { diff --git a/index.js b/index.js index 13301e3..8e53081 100644 --- a/index.js +++ b/index.js @@ -156,15 +156,20 @@ async function installBundler(platform, rubyPrefix, engine, rubyVersion) { bundlerVersion = '2' } - if (rubyVersion.startsWith('2.2')) { - console.log('Bundler 2 requires Ruby 2.3+, using Bundler 1 on Ruby 2.2') - bundlerVersion = '1' - } else if (/^\d+/.test(bundlerVersion)) { + if (/^\d+/.test(bundlerVersion)) { // OK } else { throw new Error(`Cannot parse bundler input: ${bundlerVersion}`) } + if (rubyVersion.startsWith('2.2')) { + console.log('Bundler 2 requires Ruby 2.3+, using Bundler 1 on Ruby 2.2') + bundlerVersion = '1' + } else if (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' + } + if (engine === 'ruby' && common.isHeadVersion(rubyVersion) && bundlerVersion === '2') { console.log(`Using Bundler 2 shipped with ${engine}-${rubyVersion}`) } else if (engine === 'truffleruby' && bundlerVersion === '1') {