Support Rails 8.1#103
Conversation
dmytro-savochkin
left a comment
There was a problem hiding this comment.
Thanks for such a thorough PR! Appreciate it.
Just a small question below for my understanding.
| gem "concurrent-ruby", "1.3.4" # https://stackoverflow.com/a/79361034 | ||
|
|
||
| install_if '-> { RUBY_VERSION >= "3.4.0" }' do | ||
| gem "mutex_m" # mutex_m is no longer a part of the default gems |
There was a problem hiding this comment.
So it's only needed for ActiveRecord 7.0 but not for later versions? What happens without it?
There was a problem hiding this comment.
Yes — it’s only needed for Rails 7.0 when running on Ruby 3.4.
Earlier Ruby versions bundled mutex_m in the standard library, but Ruby 3.4 removed it, which causes ActiveRecord 7.0 to fail to load without the gem.
Rails 7.0 explicitly requires mutex_m here:
https://github.com/rails/rails/blob/7-0-stable/activesupport/lib/active_support/notifications/fanout.rb#L3
Newer ActiveSupport versions already include mutex_m as a dependency (see rails/rails#48907), so they work fine without adding anything manually.
Issue #, if available:
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.