-
-
Notifications
You must be signed in to change notification settings - Fork 268
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
[Feature Request] Allow changing Rubygems version #228
Comments
Maybe it makes sense to ensure at least RubyGems 2.7.11 in |
I dislike updating RubyGems, for many reasons, #224 (comment) and https://eregon.me/blog/2020/01/13/a-migration-path-to-bundler2.html#the-rubygems-requirement-of-bundler-2. But of course if people want to update to a given RubyGems version, then that's fine as it's their explicit choice. |
Maybe it could be turned on as a boolean input? The default could be off. Currently, I'm getting this issue for a vanilla 2.5 build:
Seems to be related: rubygems/rubygems#4976 / Solution: rubygems/rubygems#4976 (comment) |
@Jack12816 That sounds like your Gemfile includes Psych 4 somehow, and the default RubyGems doesn't support it. Probably going to run into more issues by trying to use recent gems + old Ruby. |
Mhh, yeah looks like psych 4 is required by rdoc 6.4. This is then also related to not having a cached/in-repo-stored Gemfile.lock for our gem repo, which is fine from my point of view. The most convenient solution is then to drop support for ruby 2.5. But this should be reflected by this gh action, too? Why should it allow to install ruby 2.5 (or earlier) when it is obviously broken by the bundled rubygems from back then when there is an official update available with support for the language version? The latest RubyGems version 3.3.4 is compatible with Ruby >=2.3. So sounds safe to use it, because we could rely on this information also provided by other gems. |
That RubyGems is in general not broken and works for plenty of CI workflows, and it is the RubyGems version you would get when you install Ruby 2.5, so IMHO the only sane default. Regarding
One way to silence this warning is to use Bundler < 2.3.0 on those older Rubies: rubygems/rubygems#5177 (review) |
I think a From the RubyGems and Bundler maintainers side, 100% of rubygems tests are run against all supported rubies, so the use case of updating rubygems on an old Ruby is a 100% supported scenario. |
Thanks. I think many people would consider all of us to be opinionated. Somewhat related to age, along with terseness. JFYI, I'm old (60+, coded on teletypes, Apple II's, original IBM & Compaq PC's). Anway, given the increasing integration between RubyGems & Bundler, I also think an option to update RG is needed. Issues like how it functions with Off-topic: Given that RubyGems & Bundler (and all of Ruby) are OSS, the idea that a full three dimensional matrix of Ruby/RubyGems/Bundler versions can be supported is somewhat nuts. |
I looked for "opinionated" in the dictionary and I didn't use that word properly. Sincere apologies, I didn't mean it in an offensive way. I only wanted to state that this proposal would only be purely opt-in, and Eregon can still keep his opinion about not updating RubyGems being the best default. |
None needed by me. I'm American, and what is considered 'harse' is messy with 'international' conversations.
What's your opinion? I consider yours to be one of the best (if not the best) informed... |
No worries, I read it as "opiniated" and thought that just means based on some opinions but apparently that's not a word. The reason to not just add that option now is this bigger design, which I think is much more flexible: - uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0
- run: gem update --system
- run: bundle config ...
- ...
- uses: ruby/bundle-install@v1
with:
bundler: version (optional) This gives the full flexibility in between, including the full shell support from GitHub Actions, and it clearly separates the concerns. It also supports multiple gemfiles, multiple caches in a single job, etc. |
Well, as a RubyGems maintainer I obviously prefer if people use the latest version and benefit from my work. But I think a "rolling version" is not a good default, because CI environments should be as frozen as possible. So I would either use the default version that comes with each Ruby (like done now), or an upgraded but fixed version as a default. To be honest, what I like the most about this action is how it satisfies almost all use cases of setting up Ruby in a CI environment, with little to no configuration. I have migrated dozens of repositories from TravisCI and other systems to GitHub Actions, and I hardly ever encounter issues except for hitting RubyGems bugs on old rubies. That's why I believe a configuration to select the desired RubyGems version is the missing piece in this action, and there's no need to split it into different actions. I don't think the Recent RubyGems and Bundler versions are able to automatically install the proper version of Bundler itself, so if this action shipped with a recent enough RubyGems version, all the logic to find a good Bundler version could just go. All that said, I just realized that since TruffleRuby does not support upgrading RubyGems, it might get confusing if this gets added because people will expect it to work for their whole matrix, including TruffleRuby. |
I'm happy we agree on "always latest RubyGems" is not ideal for a CI default :)
It's possible to upgrade RubyGems in TruffleRuby with an extra flag to force it, but it takes quite some time (I'd need to check again), which I think most people would want to avoid in CI, and there is a potential risk the newer RubyGems doesn't work. OTOH the RubyGems in TruffleRuby is typically already fairly recent. Right, it seems kind of nice to be able to use a single action if the only extra thing is updating RubyGems.
There are two sides to this:
Related: #239 So let's go with #228 (comment). |
I went ahead and gave this a try at #271! |
#271 merged and released as https://github.com/ruby/setup-ruby/releases/tag/v1.93.0 |
Thank you very much @deivid-rodriguez and @eregon :) |
Currently, if I were to run a job using Ruby 2.4 and Rubygems 2.x, I'm locked to
rubygems-2.6.14.4
.If there's a gem that requires Rubygems 2.7 (for security reasons),
bundle install
fails, forcing me to abandon the bundle-cache provided by this action.I would therefore like to have a way to update to
rubygems-2.7.11
. Under the hood, it would be a system call toThe text was updated successfully, but these errors were encountered: