Upgrade Ruby to 4.0 via multi-stage build#171
Merged
Merged
Conversation
Bump the bundler group (#170) updated gems to versions requiring Ruby >= 3.2, but the Dockerfile was installing ruby-full via APT (Ruby 3.1 on Debian Bookworm). During docker build, bundler was silently downgrading activesupport 8.1.3 → 7.0.10 to satisfy Ruby 3.1, then COPY . . overwrote Gemfile.lock back to 8.1.3, causing Bundler::GemNotFound at runtime. - Use ruby:4.0-slim-bookworm as multi-stage source for Ruby binaries (bookworm variant ensures GLIBC compatibility with hexletbasics/base-image) - Update .rubocop.yml: plugins: instead of deprecated require:, TargetRubyVersion 4.0, disable Style/ReduceToHash (exercises intentionally use each_with_object) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.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
ruby-fullvia APT (Ruby 3.1 on Debian Bookworm /node:25-slim).activesupport 8.1.3 → 7.0.10to satisfy Ruby 3.1, thenCOPY . .overwroteGemfile.lockback to 8.1.3 — causingBundler::GemNotFoundat runtime.Fix:
ruby-fullwith a multi-stage build fromruby:4.0-slim-bookworm(Bookworm variant ensures GLIBC compatibility withhexletbasics/base-image).rubocop.yml:plugins:instead of deprecatedrequire:,TargetRubyVersion 4.0, disableStyle/ReduceToHash(exercises intentionally useeach_with_object)Test plan
docker buildcompletes successfully (all 41 gems installed, including activesupport 8.1.3, minitest 6.0.6)make code-lint— rubocop: 64 files, no offensesmake test— all tests pass, 0 failures🤖 Generated with Claude Code