Fix Ruby 2.6+ Logger compatibility issue #1482
Open
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.
Summary
Fixes CI failures with Ruby 2.6 and Rails 6.0/6.1 by adding explicit
require 'logger'.Problem
Tests are failing on Ruby 2.6 with the following error:
This affects multiple CI jobs:
Root Cause
Ruby 3.1+ moved
Loggerto a separate gem (logger), requiring explicit loading. While this primarily affects Ruby 3.1+, the issue also manifests with Ruby 2.6 and certain Rails versions where ActiveSupport tries to useLogger::Severitybefore the Logger class is loaded.Solution
Add
require 'logger'at the top oftest/test_helper.rbto ensure Logger is loaded before ActiveSupport attempts to use it.Testing
This fix should resolve the failing CI jobs while maintaining compatibility with all Ruby/Rails combinations in the test matrix.
🤖 Generated with Claude Code