Skip to content

Add workaround for Ruby 3.1 after RubyGems 3.7.0 release #780

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions bundler.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,11 @@ 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 versionParts = [...bundlerVersion.matchAll(/\d+/g)].length
const bundlerVersionConstraint = versionParts >= 3 ? bundlerVersion : `~> ${bundlerVersion}.0`

await exec.exec(gem, ['install', 'bundler', ...force, '-v', bundlerVersionConstraint])
await exec.exec(gem, ['install', 'bundler', '-v', bundlerVersionConstraint])

return bundlerVersion
}
Expand Down
9 changes: 4 additions & 5 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion rubygems.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ async function rubygemsLatest(gem, platform, engine, rubyVersion) {
const floatVersion = common.floatVersion(rubyVersion)
if (common.isHeadVersion(rubyVersion)) {
console.log('Ruby master builds use included RubyGems')
} else if (floatVersion >= 3.1) {
} else if (floatVersion >= 3.2) {
await exec.exec(gem, ['update', '--system'])
} else if (floatVersion >= 3.1) {
await exec.exec(gem, ['update', '--system', '3.6.9'])
} else if (floatVersion >= 3.0) {
await exec.exec(gem, ['update', '--system', '3.5.23'])
} else if (floatVersion >= 2.6) {
Expand Down
Loading