Skip to content

Conversation

@byroot
Copy link
Member

@byroot byroot commented Dec 30, 2023

Until now, Rails only droped compatibility with older rubies on new majors, but I propose to change this policy because it causes us to either keep compatibility with long EOLed rubies or to bump the Rails major more often, and to drop multiple Ruby versions at once when we bump the major.

In my opinion it's a bad alignments of incentives. And we'd be much better to just drop support in new minors whenever they go EOL (so 3 years).

Also Ruby being an upstream dependency, it's not even a semver violation AFAICT.

Since Rails 7.2 isn't planned before a few months, we can already drop Ruby 3.0 as it will be EOL in March.

FYI @matthewd since I think I remember you having opinions about this.

Until now, Rails only droped compatibility with older
rubies on new majors, but I propose to change this policy
because it causes us to either keep compatibility with long
EOLed rubies or to bump the Rails major more often, and to
drop multiple Ruby versions at once when we bump the major.

In my opinion it's a bad alignments of incentives. And we'd
be much better to just drop support in new minors whenever they
go EOL (so 3 years).

Also Ruby being an upstream dependency, it's not even
a semver violation AFAICT.

Since Rails 7.2 isn't planned before a few months, we
can already drop Ruby 3.0 as it will be EOL in March.
@zzak
Copy link
Member

zzak commented Dec 31, 2023

@matthewd
Copy link
Member

Yeah, I agree we should do this. Once upon a time it was more disruptive, because Rubygems/Bundler couldn't account for ruby versions during resolution, and so could settle on a version of a gem that would then not work once installed. But that time is no more.

Dropping upstream-unsupported rubies regularly gives users a clearer upgrade path if doing a long catch-up, by better communicating a range of versions that the given Rails version actually spends most of its life running on. No-one should be running Rails 7.1 on now-EOL Ruby 2.7 today, let alone doing so with 7.2 when it's released.

Since Rails 7.2 isn't planned before a few months, we can already drop Ruby 3.0 as it will be EOL in March.

I'm inclined to push one version further forward than that, even, and cut off any version that's in security-only mode at the time of our release (as a general policy, regardless of whether a specific version boundary gives us compelling syntax etc). That's what we've done previously when updating it in majors. But I do also feel less strongly about the need to be that strict if we're revising our minimum more often than once every 2-3 years.

(My "that's unreasonable" floor, for comparison, is that any Rails release should support [the now-current patch release of] the version of Ruby that was the latest/current available 12 months earlier.)

@zzak
Copy link
Member

zzak commented Dec 31, 2023

Was looking at 6487836 for inspiration and also opened byroot#2 to cover the version checker and other relevant docs. 🙏

@skipkayhil
Copy link
Member

to cover the version checker

I'm curious if we still need this. It feels like a remnant of having to address the problems with RubyGems/Bundler that Matthew mentioned above.

@zzak
Copy link
Member

zzak commented Dec 31, 2023

to cover the version checker

I'm curious if we still need this. It feels like a remnant of having to address the problems with RubyGems/Bundler that Matthew mentioned above.

I didn't actually look into the purpose of that file, just looking for the most recent ruby version bump last night. Now that you mention it though, that does seem like an accurate assessment: https://github.com/rails/rails/blame/391f2543c96a9b3de4e44f4ea6aeee2f53ad9e5c/railties/bin/rails#L5

edit: Updated byroot#2 to remove the version checker. 🙏

zzak and others added 2 commits December 31, 2023 12:38
Also includes relevant docs, inspired by 6487836
Until now, Rails only droped compatibility with older
rubies on new majors, but I propose to change this policy
because it causes us to either keep compatibility with long
EOLed rubies or to bump the Rails major more often, and to
drop multiple Ruby versions at once when we bump the major.

In my opinion it's a bad alignments of incentives. And we'd
be much better to just drop support in new minors whenever they
go EOL (so 3 years).

Also Ruby being an upstream dependency, it's not even
a semver violation AFAICT.

Since Rails 7.2 isn't planned before a few months, we
can already drop Ruby 3.0 as it will be EOL in March.
@byroot byroot force-pushed the bump-required-ruby branch from 89c2f85 to 6ba2fdb Compare December 31, 2023 07:54
@byroot
Copy link
Member Author

byroot commented Dec 31, 2023

But I do also feel less strongly about the need to be that strict if we're revising our minimum more often than once every 2-3 years.

Yeah, that's my whole point. If we drop more regularly we avoid the need to drop so many at once. Right now I don't see anything in 3.1 that would make our life harder, so I'm not very inclined to drop it. But we can always change our mind before the release if we run into something, it's much easier to drop compatibility than to restore it.

@rails-bot rails-bot bot added the docs label Dec 31, 2023
@byroot
Copy link
Member Author

byroot commented Dec 31, 2023

Alright, since Matthew has no objections, I'll merge now, might as well reduce CI load while we're at it :)

@byroot byroot merged commit c2636a6 into rails:main Dec 31, 2023
tagliala added a commit to enriclluelles/route_translator that referenced this pull request Jan 1, 2024
tagliala added a commit to ifad/chronomodel that referenced this pull request Jan 1, 2024
- Test against 3.3
- Do not test Rails edge against 2.7 (rails/rails#50491)
tagliala added a commit to ifad/chronomodel that referenced this pull request Jan 1, 2024
- Test against 3.3
- Do not test Rails edge against 2.7 (rails/rails#50491)
tagliala added a commit to tagliala/validates_timeliness that referenced this pull request Jan 4, 2024
Also:
- Set 7.1 as the default Rails in Gemfile
- Do not test Rails edge against Ruby < 3.1 (rails/rails#50491)
y-yagi added a commit to y-yagi/lograge that referenced this pull request Jan 12, 2024
y-yagi added a commit to y-yagi/lograge that referenced this pull request Jan 12, 2024
y-yagi added a commit to y-yagi/lograge that referenced this pull request May 27, 2024
y-yagi added a commit to y-yagi/lograge that referenced this pull request May 27, 2024
benlovell pushed a commit to roidrage/lograge that referenced this pull request May 30, 2024
* Rails edge requires Ruby version >= 3.1

Ref: rails/rails#50491

* Fix Rubocop offences

* Add `mutex_m`a and `base64` to dev dependencies

`mutex_m` and `base64` are bundled gem since Ruby 3.4.

Rails uses `mutex_m` and `base64` and newer versions add those as
dependencies.
Ref: rails/rails#48907

But, old Rails aren't supported. So we need to add those gems
to run CI.
yahonda added a commit to yahonda/oracle-enhanced that referenced this pull request Jun 16, 2025
This commit bumps the minimum Ruby version to 3.1

- Rails 7.2 requires Ruby 3.1
rails/rails#50491
https://guides.rubyonrails.org/7_2_release_notes.html#make-ruby-3-1-the-new-minimum-version

- Remove workaround for Ruby 2.7
rsim@8cb2077

```ruby
 % ruby -v
ruby 3.1.7p261 (2025-03-26 revision 0a3704f218) [arm64-darwin25]
% gem -v
3.3.27
% bundler -v
Bundler version 2.3.27
% gem update --system
Updating rubygems-update
Fetching rubygems-update-3.6.9.gem
Successfully installed rubygems-update-3.6.9
Parsing documentation for rubygems-update-3.6.9
Installing ri documentation for rubygems-update-3.6.9
Done installing documentation for rubygems-update after 2 seconds
Parsing documentation for rubygems-update-3.6.9
Done installing documentation for rubygems-update after 0 seconds
Installing RubyGems 3.6.9
  Successfully built RubyGem
  Name: bundler
  Version: 2.6.9
  File: bundler-2.6.9.gem
Bundler 2.6.9 installed
RubyGems 3.6.9 installed
Regenerating binstubs
Regenerating plugins
Parsing documentation for rubygems-3.6.9
Installing ri documentation for rubygems-3.6.9

... snip ...
RubyGems system software updated
~ % gem -v
3.6.9
```
- Bump the TargetRubyVersion in .rubocop.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants