Add logger gem to fix Ruby 4.0 deprecation warning#63
Merged
Conversation
Ruby 3.4+ warns that logger will no longer be a default gem in Ruby 4.0. Explicitly adding it to Gemfile prevents this warning: 'warning: logger was loaded from the standard library, but will no longer be part of the default gems starting from Ruby 4.0.0.' The logger gem is a dependency of excon (used by docker-api), but it's being transitioned from a default gem to a regular gem. By explicitly including it, we: - Silence the deprecation warning - Ensure forward compatibility with Ruby 4.0 - Make the dependency explicit rather than implicit Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
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.
Summary
Fixes Ruby 4.0 deprecation warning by explicitly adding the
loggergem to dependencies.Problem
When running tests with Ruby 3.4+, this warning appears:
Root Cause
The
loggergem is currently a default gem in Ruby (included automatically), but starting with Ruby 4.0, it will become a regular gem that must be explicitly installed.The
excongem (dependency ofdocker-api) uses logger, which triggers this warning in Ruby 3.4+ as a heads-up about the upcoming change.Solution
Explicitly add
loggerto Gemfile:Benefits
✅ Silences deprecation warning - Clean test output
✅ Forward compatibility - Ready for Ruby 4.0
✅ Explicit dependency - Makes dependency clear rather than implicit
✅ No breaking changes - Works with all Ruby versions
Testing
✅ All tests pass without warnings
✅ No behavioral changes
✅ Compatible with Ruby 3.4 and future versions