Use Bundler 1 on Ruby 2.3

* At least until there is a new Bundler 2 release fixing this.
* Fixes https://github.com/ruby/setup-ruby/issues/51
This commit is contained in:
Benoit Daloze
2020-06-06 13:16:46 +02:00
parent a7df86edc6
commit b04e5b8846
3 changed files with 19 additions and 9 deletions
+1 -1
View File
@@ -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.
Generated Vendored
+9 -4
View File
@@ -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') {
+9 -4
View File
@@ -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') {