From f66e1124dc15658333003d8edd60c3ed913dd8a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Wed, 16 Jul 2025 12:11:35 +0200 Subject: [PATCH] Don't use `--force` flag on Windows It was originally added by https://github.com/ruby/setup-ruby/pull/253, in order to fix CI. However, now CI passes without it so I assume this was fixed by rubyinstaller2. Force actually bypasses dependency constraints so it's actually installing the latest Bundler in a version of Ruby that's incompatible with it. --- bundler.js | 3 +-- dist/index.js | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/bundler.js b/bundler.js index 8c945d6..e766151 100644 --- a/bundler.js +++ b/bundler.js @@ -137,9 +137,8 @@ export async function installBundler(bundlerVersionInput, rubygemsInputSet, lock } const gem = path.join(rubyPrefix, 'bin', 'gem') - // Workaround for https://github.com/rubygems/rubygems/issues/5245 // and for https://github.com/oracle/truffleruby/issues/2780 - const force = ((platform.startsWith('windows-') && engine === 'ruby' && floatVersion >= 3.1) || (engine === 'truffleruby')) ? ['--force'] : [] + const force = engine === 'truffleruby' ? ['--force'] : [] const versionParts = [...bundlerVersion.matchAll(/\d+/g)].length const bundlerVersionConstraint = versionParts >= 3 ? bundlerVersion : `~> ${bundlerVersion}.0` diff --git a/dist/index.js b/dist/index.js index 9d18b04..71529be 100644 --- a/dist/index.js +++ b/dist/index.js @@ -151,9 +151,8 @@ async function installBundler(bundlerVersionInput, rubygemsInputSet, lockFile, p } const gem = path.join(rubyPrefix, 'bin', 'gem') - // Workaround for https://github.com/rubygems/rubygems/issues/5245 // and for https://github.com/oracle/truffleruby/issues/2780 - const force = ((platform.startsWith('windows-') && engine === 'ruby' && floatVersion >= 3.1) || (engine === 'truffleruby')) ? ['--force'] : [] + const force = engine === 'truffleruby' ? ['--force'] : [] const versionParts = [...bundlerVersion.matchAll(/\d+/g)].length const bundlerVersionConstraint = versionParts >= 3 ? bundlerVersion : `~> ${bundlerVersion}.0`