Skip to content

Instantly share code, notes, and snippets.

@pboling
Created February 26, 2024 09:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pboling/cdb3baf07cac2d2bc91124367f858263 to your computer and use it in GitHub Desktop.
Save pboling/cdb3baf07cac2d2bc91124367f858263 to your computer and use it in GitHub Desktop.
RubyGems versions for Ruby versions
// From: https://github.com/ruby/setup-ruby/pull/551/files#diff-344d865bd0fa41eafba66242f01ff940b063438e51ec83de8e4a613910ee9637R38-R55
if (engine === 'ruby') {
const rubyFloatVersion = common.floatVersion(version)
if (common.isHeadVersion(version)) {
console.log('Ruby master builds use included RubyGems')
} else if (rubyFloatVersion >= 3.0) {
await exec.exec(gem, ['update', '--system'])
} else if (rubyFloatVersion >= 2.6) {
await exec.exec(gem, ['update', '--system', '3.4.22'])
} else if (rubyFloatVersion >= 2.3) {
await exec.exec(gem, ['update', '--system', '3.3.27'])
} else {
console.log(`Cannot update RubyGems for Ruby version ${version}`)
}
} else {
// non MRI Rubies (TruffleRuby and JRuby)
await exec.exec(gem, ['update', '--system'])
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment