Fix check for TruffleRuby < 21.0 and Bundler 1

This commit is contained in:
Benoit Daloze
2021-07-27 13:35:24 +02:00
parent 0c7e9c4d53
commit 0997e21bf3
3 changed files with 13 additions and 4 deletions
+2 -2
View File
@@ -86,8 +86,8 @@ export async function installBundler(bundlerVersionInput, lockFile, platform, ru
// Avoid installing a newer Bundler version for head versions as it might not work.
// For releases, even if they ship with Bundler 2 we install the latest Bundler.
console.log(`Using Bundler 2 shipped with ${engine}-${rubyVersion}`)
} else if (engine === 'truffleruby' && !common.isHeadVersion(rubyVersion) && bundlerVersion.startsWith('1')) {
console.log(`Using Bundler 1 shipped with ${engine}`)
} else if (engine === 'truffleruby' && common.isBundler1Default(engine, rubyVersion) && bundlerVersion.startsWith('1')) {
console.log(`Using Bundler 1 shipped with ${engine}-${rubyVersion}`)
} else {
const gem = path.join(rubyPrefix, 'bin', 'gem')
const bundlerVersionConstraint = bundlerVersion.match(/^\d+\.\d+\.\d+/) ? bundlerVersion : `~> ${bundlerVersion}`