Skip to content
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

Ruby 2.3 to 2.5 can't install bundler #422

Closed
2 tasks done
MaxLap opened this issue Dec 24, 2022 · 17 comments · Fixed by #423
Closed
2 tasks done

Ruby 2.3 to 2.5 can't install bundler #422

MaxLap opened this issue Dec 24, 2022 · 17 comments · Fixed by #423

Comments

@MaxLap
Copy link

MaxLap commented Dec 24, 2022

Ensure the following before filing this issue

  • I verified it reproduces with the latest version with - uses: ruby/setup-ruby@v1 (see Versioning policy)

  • I tried to reproduce the issue locally by following the workflow steps (including all commands done by ruby/setup-ruby, except for Downloading Ruby & Extracting Ruby),
    and it did not reproduce locally (if it does reproduce locally, it's not a ruby/setup-ruby issue)

Are you running on a GitHub-hosted runner or a self-hosted runner?

GitHub-hosted runner

The workflow code or a link to the workflow file

https://github.com/MaxLap/activerecord_where_assoc/blob/master/.github/workflows/run_tests.yml

Link to the log of a failed workflow job, or to a gist with the output

https://github.com/MaxLap/activerecord_where_assoc/actions/runs/3771542199/jobs/6412280221

The command and output of the failing step

On a Ruby 2.3 to 2.5 installation (I tested the command with ruby 2.4.10p364 locally and have the same problem):


gem install bundler -v '~> 2.0'
ERROR:  Error installing bundler:
	The last version of bundler (~> 2.0) to support your Ruby & RubyGems was 2.3.26. Try installing it with `gem install bundler -v 2.3.26`
	bundler requires Ruby version >= 2.6.0. The current ruby version is 2.4.10.364.


### Any other notes?

I know since I can reproduce locally, you say it's not a setup-ruby bug, but I think in this case, it is, since it seems setup-ruby is using the wrong command in that case.

Bundler 2.4.0 was just released, which has a minimum Ruby version of 2.6.

The default bundle installation command of `gem install bundler -v '~> 2.0'` doesn't work on those Ruby version because it seems `gem install` only uses the `~= 2.0` to pick the latest version, not necessarily one that is compatible with the current Ruby.

@deivid-rodriguez
Copy link
Contributor

deivid-rodriguez commented Dec 24, 2022

Bundler 2.4 has dropped support for Ruby 2.3, Ruby 2.4 and Ruby 2.5. But the RubyGems version provided with these rubies cannot handle gem install bundler -v '~> 2.0' well if the latest version of Bundler does not support these rubies. Like it started happening now.

The solution is that ruby/setup-ruby provides at least RubyGems 3.2.3 by default on these rubies. RubyGems 3.2.3 or higher handles this situation just fine by installing the latest compatible version of Bundler (in this case, 2.3.26).

@MSP-Greg
Copy link
Collaborator

I assume this is because the RubyGems included with Ruby 2.3 thru 2.5 doesn't support required_ruby_version?

I think this was discussed previously. Maybe an input choice for rubygems that forces Ruby 2.3 thru 2.5 to install RG 3.2.3, and leaves Ruby 2.6 and later alone? This issue also breaks Puma CI, and probably many others.

@deivid-rodriguez
Copy link
Contributor

deivid-rodriguez commented Dec 24, 2022

I think it should be the default, at least for those old rubies. No need for an extra input. Alternatively, scope the gem install bundler command more on those Rubies (like gem install bundler -v '~> 2.3.26').

@deivid-rodriguez
Copy link
Contributor

I assume this is because the RubyGems included with Ruby 2.3 thru 2.5 doesn't support required_ruby_version?

Yes.

@MSP-Greg
Copy link
Collaborator

I think it should be the default, at least for those old rubies

I really don't like the idea of updating RubyGems by default. There should be an easy way to fix this without any changes to RubyGems on Ruby 2.6 and later. My opinion, open to any fix...

@MaxLap
Copy link
Author

MaxLap commented Dec 24, 2022

Ideally, whatever fix done wouldn't require every repo using setup-ruby on older rubies to change their config.

A safe way, altho somewhat dirty, could be to add a "< 2.4" to the version requirement when ruby is less than 2.6. There are already a few special cases in the code for installing bundler, so that doesn't seem too terrible.

gem install bundler -v '~> 2.0, < 2.4' appears to work locally.

@deivid-rodriguez
Copy link
Contributor

@MSP-Greg What I meant is what @MaxLap said, users should not need to change anything. I don't mind what the underlying solution is.

@MSP-Greg
Copy link
Collaborator

Yes, that is probably best.

@eregon
Copy link
Member

eregon commented Dec 24, 2022

Please do not release an incompatibile Bundler change on Christmas :/
I don't think it's acceptable to slow down workflows by updating RubyGems or do it behind the user's back.
Adding a Bundler version constraint seems fine.

Bundler should have used a new major version (3.0) for such a change, that would not have broken things needlessly (it reminds me of Bundler 2.0).

@deivid-rodriguez
Copy link
Contributor

We were aware of this potential issue and decided no to cut major versions for this kind of incompatibility that only affects combinations of old rubies + old rubygems. We decided to do this for Christmas release also intentionally.

Had I recalled issues like #228 though, where the warning we've been giving for a year was brought up, I would have proposed an update to ruby/setup-ruby, but I missed it :( Of course, you could've also updated this yourself, specially since you were part of the original discussion where we added the warning about this in Bundler. We are all humans and forget things, make mistakes, or make intentional decisions that others see as bad decisions. It happens!

Fortunately, in this case, it should be easy to change things so that most users don't notice anything.

Anyways, I'm sorry the way we maintain our libraries doesn't please you. I have to say I do get tired of so much negativity from you side Benoit, and that's very rare in our community, so I'm not really used to it and it sucks my energy. Because of that, I will unsubscribe from this post now. Happy Christmas!

@simi
Copy link

simi commented Dec 24, 2022

I think the solution is clear. Don't use EOL Ruby or get a EOL Ruby support on your own. In case of emergency, just lock all (including RubyGems and Bundler) in your workflow on your own.

@eregon
Copy link
Member

eregon commented Dec 24, 2022

I don't understand why one would release a new big Bundler version at Christmas. We all have better things to do I believe. It seems it will just maximize the time things are broken and the frustration.

@eregon
Copy link
Member

eregon commented Dec 24, 2022

I do wish you all a happy Christmas/holidays

@hsbt
Copy link
Member

hsbt commented Dec 24, 2022

I don't understand why one would release a new big Bundler version at Christmas.

Because It's for Ruby 3.2.

@hsbt
Copy link
Member

hsbt commented Dec 24, 2022

I submit a PR for fix this #423

@eregon
Copy link
Member

eregon commented Dec 25, 2022

https://github.com/ruby/setup-ruby/releases/tag/v1.129.0

@eregon
Copy link
Member

eregon commented Dec 25, 2022

To expand on #422 (comment) which was apparently not well received but was intended to just be factual.

I do support dropping support for EOL Rubies in gems, and my opinion is this does not require a major version of the gem (which would just be extra maintenance effort unwarranted for it). However, that's if required_ruby_version works, otherwise a new major version seems necessary.

Here we knew required_ruby_version did not work well. And that various usages including setup-ruby did gem install ~> 2 notably to protect from a Bundler 3 dropping support for older Rubies. So it would have just worked if it was Bundler 3.0. But instead we annoy a bunch of open-source maintainers on Christmas eve and day, that's unfortunate.

Because It's for Ruby 3.2.

I guess we need to give a version to Bundler inside ruby/ruby at 3.2 release.
But I think it would be much more helpful to release big changes like dropping old Ruby versions before Christmas, say 1-2 weeks before when people can react to it without interrupting their holidays (e.g., I can literally not release setup-ruby from my phone).
So we would have 2.4.0 ~2 weeks ago (i.e., after rubygems/rubygems@77e7b79) and then some 2.4.1/2.4.2 on Ruby 3.2.0 release date.
Here is to hoping we can avoid breaking changes at this time of the year in the future.

dentarg added a commit to spinels/overman that referenced this issue Dec 25, 2022
Do not try to install latest RubyGems due to ruby/setup-ruby#422
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

6 participants