Skip to content

upgrade: ruby 4.0.2 → 4.0.3 and fix devcontainer base image#6928

Merged
compwron merged 2 commits intomainfrom
devcontainer
May 5, 2026
Merged

upgrade: ruby 4.0.2 → 4.0.3 and fix devcontainer base image#6928
compwron merged 2 commits intomainfrom
devcontainer

Conversation

@compwron
Copy link
Copy Markdown
Collaborator

@compwron compwron commented May 4, 2026

Stick to versions in https://devcenter.heroku.com/articles/ruby-support-reference#supported-ruby-versions
4.0.3, Rubygems: 4.0.6

Summary

  • Devcontainer was broken: base image mcr.microsoft.com/devcontainers/ruby:dev-3.3-bookworm shipped Ruby 3.3 while .ruby-version pinned 4.0.2, so bundle install rejected the system Ruby and rspec/bin/setup failed in fresh codespaces.
  • Bumped the devcontainer base to dev-4.0-bookworm (currently ships Ruby 4.0.3) and aligned the project from 4.0.2 → 4.0.3 across .ruby-version, .tool-versions, Gemfile, Gemfile.lock, the production Dockerfile, flake.nix, and the setup docs.
  • Replaced the buggy hardcoded if [ "$RUBY_VERSION" != "4.0.2" ] gate by giving .devcontainer/Dockerfile a conditional rvm-install step that compares the system Ruby against .ruby-version. With patches now aligned (both 4.0.3) this is a no-op — codespace rebuilds don't need a slow rvm source compile.
  • gemset.nix was intentionally left alone — its 4.0.2 is a gem version (dotenv), not Ruby.

Test plan

  • Rebuild codespace from this branch; confirm ruby -v reports 4.0.3 and that bundle install / bin/setup / rspec all succeed without an rvm install pass.
  • Run bundle install locally on Ruby 4.0.3 to confirm Gemfile.lock still resolves cleanly (the RUBY VERSION line was hand-edited).
  • Build the production Dockerfile and smoke-boot the app on ruby:4.0.3-alpine.
  • Nix users: confirm the pinned nixpkgs exposes ruby-4.0.3 (otherwise inputs need updating).

🤖 Generated with Claude Code

The devcontainer base (ruby:dev-3.3-bookworm) shipped Ruby 3.3 while the
project pinned 4.0.2, so bundle install failed in codespaces. Bump the
base to dev-4.0-bookworm and align the project to 4.0.3 so codespace
builds don't need a slow rvm compile.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added the dependencies Touches dependency files label May 4, 2026
bin/setup previously installed whatever bundler version was latest and
then rewrote BUNDLED WITH via 'bundle update --bundler', so the lockfile
silently drifted whenever a developer ran setup. Pin to 4.0.6 — the
version Heroku supports for our Ruby — and drop the auto-rewrite step.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@compwron compwron merged commit 813e04e into main May 5, 2026
12 checks passed
@compwron compwron deleted the devcontainer branch May 5, 2026 05:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Touches dependency files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant