Skip to content

Commit b04e5b8

Browse files
committed
Use Bundler 1 on Ruby 2.3
* At least until there is a new Bundler 2 release fixing this. * Fixes #51
1 parent a7df86e commit b04e5b8

File tree

3 files changed

+19
-9
lines changed

3 files changed

+19
-9
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ and the [condition and expression syntax](https://help.github.com/en/actions/ref
112112

113113
By default, if there is a `Gemfile.lock` file with a `BUNDLED WITH` section,
114114
the latest version of Bundler with the same major version will be installed.
115-
Otherwise, the latest Bundler version is installed (except for Ruby 2.2 where only Bundler 1 is supported).
115+
Otherwise, the latest Bundler version is installed (except for Ruby 2.2 and 2.3 where only Bundler 1 is supported).
116116

117117
This behavior can be customized, see [action.yml](action.yml) for details about the `bundler` input.
118118

dist/index.js

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

index.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,15 +156,20 @@ async function installBundler(platform, rubyPrefix, engine, rubyVersion) {
156156
bundlerVersion = '2'
157157
}
158158

159-
if (rubyVersion.startsWith('2.2')) {
160-
console.log('Bundler 2 requires Ruby 2.3+, using Bundler 1 on Ruby 2.2')
161-
bundlerVersion = '1'
162-
} else if (/^\d+/.test(bundlerVersion)) {
159+
if (/^\d+/.test(bundlerVersion)) {
163160
// OK
164161
} else {
165162
throw new Error(`Cannot parse bundler input: ${bundlerVersion}`)
166163
}
167164

165+
if (rubyVersion.startsWith('2.2')) {
166+
console.log('Bundler 2 requires Ruby 2.3+, using Bundler 1 on Ruby 2.2')
167+
bundlerVersion = '1'
168+
} else if (rubyVersion.startsWith('2.3')) {
169+
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')
170+
bundlerVersion = '1'
171+
}
172+
168173
if (engine === 'ruby' && common.isHeadVersion(rubyVersion) && bundlerVersion === '2') {
169174
console.log(`Using Bundler 2 shipped with ${engine}-${rubyVersion}`)
170175
} else if (engine === 'truffleruby' && bundlerVersion === '1') {

0 commit comments

Comments
 (0)