Skip to content

Upgrade Ruby to 4.0 via multi-stage build#171

Merged
fey merged 1 commit into
mainfrom
fix/upgrade-ruby-4
Jun 1, 2026
Merged

Upgrade Ruby to 4.0 via multi-stage build#171
fey merged 1 commit into
mainfrom
fix/upgrade-ruby-4

Conversation

@fey
Copy link
Copy Markdown
Contributor

@fey fey commented Jun 1, 2026

Summary

  • PR Bump the bundler group with 7 updates #170 (dependabot gem bumps) caused CI to fail: new gems require Ruby ≥ 3.2, but the Dockerfile installed ruby-full via APT (Ruby 3.1 on Debian Bookworm / node:25-slim).
  • 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.

Fix:

  • Replace APT ruby-full with a multi-stage build from ruby:4.0-slim-bookworm (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)

Test plan

  • docker build completes successfully (all 41 gems installed, including activesupport 8.1.3, minitest 6.0.6)
  • make code-lint — rubocop: 64 files, no offenses
  • make test — all tests pass, 0 failures

🤖 Generated with Claude Code

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>
@fey fey merged commit 531af9b into main Jun 1, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant