Do not install Bundler 2 for ruby-head since it already ships a version that might work better

This commit is contained in:
Benoit Daloze
2020-04-03 23:58:23 +02:00
parent c68e25cb8c
commit c40ce85201
2 changed files with 14 additions and 2 deletions
Generated Vendored
+7 -1
View File
@@ -1115,7 +1115,9 @@ async function installBundler(platform, rubyPrefix, engine, rubyVersion) {
if (engine === 'rubinius') {
console.log(`Rubinius only supports the version of Bundler shipped with it`)
} else if (bundlerVersion === '1' && engine === 'truffleruby') {
} else if (engine === 'ruby' && isHeadVersion(rubyVersion) && bundlerVersion === '2') {
console.log(`Using the Bundler version shipped with ${engine}-${rubyVersion}`)
} else if (engine === 'truffleruby' && bundlerVersion === '1') {
console.log(`Using the Bundler version shipped with ${engine}`)
} else {
const gem = path.join(rubyPrefix, 'bin', 'gem')
@@ -1123,6 +1125,10 @@ async function installBundler(platform, rubyPrefix, engine, rubyVersion) {
}
}
function isHeadVersion(rubyVersion) {
return rubyVersion === 'head' || rubyVersion === 'mingw' || rubyVersion === 'mswin'
}
function getVirtualEnvironmentName() {
const platform = os.platform()
if (platform === 'linux') {
+7 -1
View File
@@ -157,7 +157,9 @@ async function installBundler(platform, rubyPrefix, engine, rubyVersion) {
if (engine === 'rubinius') {
console.log(`Rubinius only supports the version of Bundler shipped with it`)
} else if (bundlerVersion === '1' && engine === 'truffleruby') {
} else if (engine === 'ruby' && isHeadVersion(rubyVersion) && bundlerVersion === '2') {
console.log(`Using the Bundler version shipped with ${engine}-${rubyVersion}`)
} else if (engine === 'truffleruby' && bundlerVersion === '1') {
console.log(`Using the Bundler version shipped with ${engine}`)
} else {
const gem = path.join(rubyPrefix, 'bin', 'gem')
@@ -165,6 +167,10 @@ async function installBundler(platform, rubyPrefix, engine, rubyVersion) {
}
}
function isHeadVersion(rubyVersion) {
return rubyVersion === 'head' || rubyVersion === 'mingw' || rubyVersion === 'mswin'
}
function getVirtualEnvironmentName() {
const platform = os.platform()
if (platform === 'linux') {