MONGOID-5932 Add Ruby 4.0 support to 9.0-stable#6136
Merged
jamis merged 1 commit intomongodb:9.0-stablefrom Apr 24, 2026
Merged
MONGOID-5932 Add Ruby 4.0 support to 9.0-stable#6136jamis merged 1 commit intomongodb:9.0-stablefrom
jamis merged 1 commit intomongodb:9.0-stablefrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Backports Ruby 4.0 support work from master to the 9.0-stable branch by updating specs, dependencies, and Evergreen CI matrices for newer Ruby/JRuby and MongoDB versions.
Changes:
- Adjusted specs to account for Ruby 3.4+ Hash#inspect formatting.
- Reworked integration app tests to generate Sinatra/Rails apps on the fly and added Ruby/Rails compatibility skips/workarounds.
- Updated gem/runtime and CI compatibility metadata (gemspec, README, Evergreen config, submodules).
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
spec/mongoid/errors/document_not_found_spec.rb |
Makes the error message assertion tolerant of Ruby 3.4+ hash inspect format. |
spec/integration/app_spec.rb |
Switches from cloned/local apps to generated apps; adds Ruby/Rails skip logic and Rails logger workarounds. |
mongoid.gemspec |
Adds ostruct runtime dependency for Ruby 4.0 compatibility. |
README.md |
Updates stated compatibility ranges for MRI/JRuby and MongoDB server. |
.gitmodules |
Removes the test-apps submodule entry. |
.evergreen/config/variants.yml.erb |
Expands test matrix to include Ruby 4.0, ruby-dev, JRuby 10.0, and newer MongoDB versions. |
.evergreen/config/axes.yml.erb |
Adds Ruby 3.4/4.0/ruby-dev, JRuby 10.0, Ubuntu 24.04, and MongoDB 8.2 axes. |
.evergreen/config.yml |
Applies the same axis/matrix updates to the generated Evergreen config. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
comandeo-mongo
approved these changes
Apr 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ruby 4.0 support was add previously for the master branch (#6082). This backports those changes to the 9.0-stable branch.