Skip to content

Update Ruby to 4.0.9 and Rails to 8.1.4.1 - #41

Merged
vitobotta merged 2 commits into
mainfrom
ruby-rails-upgrade
Nov 6, 2026
Merged

vitobotta merged 2 commits into
mainfrom
ruby-rails-upgrade

Conversation

@vitobotta

@vitobotta vitobotta commented Nov 5, 2026 •

Copy link
Copy Markdown
Owner

What this does

Moves the app to Ruby 4.0.5 → 4.0.9 and Rails 8.1.4 → 8.1.4.1, and refreshes every gem the lock can resolve to a newer version. No application code changes.

Before After
Ruby 4.0.5 4.0.9
Rails 8.1.4 8.1.4.1
Gems changed 17 (no downgrades, none removed)

Files: .ruby-version, Dockerfile (ARG RUBY_VERSION), Gemfile (Rails floor ~> 8.1.4, >= 8.1.4.1), Gemfile.lock, README.md (Ruby badge and the "Local development uses Ruby …" sentence). The ruby:4.0.9-slim tag exists in the registry, so the production image resolves.

Gems that moved, and why

Gem Change Driver
rails + 10 framework gems 8.1.4 → 8.1.4.1 security release
nokogiri 1.19.4 → 1.19.7 required by rails-html-sanitizer 1.7.2
rails-html-sanitizer / loofah / crass 1.7.1→1.7.2 / 2.25.2→2.25.3 / 1.0.7→1.0.8 GHSA-2p2f-4rq4-gjwc chain
rack / rack-test 3.2.7→3.2.8 / 2.2.0→2.3.0 routine
solid_queue 1.7.0 → 1.7.2 routine
sqlite3 2.10.1 → 2.10.2 routine
tailwindcss-rails 4.6.0 → 4.7.0 routine (tailwindcss-ruby 4.3.3)
cuprite / ferrum 0.19→0.20 / 0.19.1→0.20.1 routine (test)
bootsnap, addressable, faraday, io-console, msgpack, net-scp, net-sftp, net-ssh, parser, rubocop patch/minor routine

BUNDLED WITH also moved 4.0.12 → 4.0.23: that is the bundler shipped with Ruby 4.0.9, rewritten by bundle update (not --bundler). CI's ruby/setup-ruby reads .ruby-version and installs the matching bundler, so no workflow change is needed.

Four gems remain outdated because a dependent caps them: diff-lcs 1.6.2 (rspec-expectations/rspec-mocks < 2.0), marcel 1.2.1 (activestorage ~> 1.0), net-ssh 7.3.8 (kamal ~> 7.3), prism 1.9.0 (rubocop-ast ~> 1.7, minitest ~> 1.5). They cannot move without upstream changes.

Context and Motivation

Rails 8.1.4.1 is a security release. Reachability in this app:

  • Action Pack / ActionController::Live (GHSA-rwvh-fw6r-pwvp) — the fix for a stream blocking when a full buffer is closed or aborted lands in transcode_controller / direct_stream_controller, the app's streaming core. Reachable, and directly relevant to the write-timeout investigation in gotchas.md.
  • Action Pack / RemoteIp (GHSA-2gff-2mmg-m73p) — requests carrying conflicting Forwarded and X-Forwarded-For now raise IpSpoofAttackError. The app sits behind Dokku's nginx, so this is the one to watch on the first deploy.
  • Action Pack / Vary (GHSA-r9jg-fmfx-2gv6) — rendered responses now vary on Accept / X-Requested-With when the format is not in the URL.
  • Not reachable here: ActiveSupport MessagePack and safe_constantize (no MessagePack, no constantize, no Action Cable), Action View strip_tags / highlight / tag-helper attribute names (none used), the CacheStore-session and skip-session-cookie fixes (CookieStore), Parameters#each_key (no mass assignment from it), and the whole Active Storage / Action Mailbox group (neither is installed — the ffmpeg demuxer whitelist does not touch Media::Transcoder, which shells out itself).
  • Ruby 4.0.9 fixes Onigmo regexp-compilation bugs behind GitLab's CVE-2026-89078 / 93577 / 97229 / 110264. No Regexp.new, Regexp.compile, Regexp.union or interpolated regexp literal exists in app/, lib/ or config/, so there is no attacker-controlled pattern compilation.

Test fixture

spec/services/media_transcoder_spec.rb had a 0.5 second deadline on a child it had just spawned, so the child had to boot a Ruby interpreter and write its cue inside that window. Under load the reader never saw the output and the example failed on expected "" to include "Hello" — about one run in six, in isolation as well as in the full suite, and matching the intermittent failure logged in .learnings/ERRORS.md in July. The child now gets 2 s and the "returned before the 10 s sleep" assertion moved from 3 s to 5 s; the example still covers a timeout that fires after cues were written. 10/10 isolated runs and 3 consecutive full-suite runs are green after the change.

Verification

Run locally on Ruby 4.0.9 / Rails 8.1.4.1:

  • bundle check — dependencies satisfied
  • bin/rails about — Rails 8.1.4.1, ruby 4.0.9, Rack 3.2.8, sqlite3 adapter
  • RAILS_ENV=test SKIP_DB_UNIQUENESS_VALIDATOR_INDEX_CHECK=true bin/rails zeitwerk:check — "All is good!"
  • full RSpec suite — 494 examples, 0 failures, three consecutive runs, coverage 91.48% line / 71.72% branch
  • bin/rubocop — 172 files inspected, no offenses
  • bin/brakeman --no-pager -q — Security Warnings: 0, exit 0
  • bin/bundler-audit — No vulnerabilities found
  • bin/importmap audit — No vulnerable packages found
  • node --test spec/javascript/*_test.mjs — 500 pass, 0 fail
  • bin/rails tailwindcss:build — tailwindcss v4.3.3, 58k stylesheet

The whole suite ran locally because this repo's CI has no test job; it takes ~10 s.

No new deprecations: the SimpleCov.add_filter / track_files warnings and Rack's :unprocessable_entity → :unprocessable_content warning are both emitted by gem versions already in the lock at the base commit.

Not verified: the production Docker image build (tag existence checked only), and a real streaming session against the new ActionController::Live teardown.

The example timed out after 0.5s while the child it had just spawned still
had to boot a Ruby interpreter and write its cue, so under load the reader
never saw the output and the example failed on `expected "" to include
"Hello"` roughly once in six runs (in isolation and in the full suite).
Give the child 2s and keep the "returned before the 10s sleep" assertion at
5s. The example still exercises a timeout that fires after cues were written.
@vitobotta
vitobotta merged commit 95be471 into main Nov 6, 2026
3 checks passed
@vitobotta
vitobotta deleted the ruby-rails-upgrade branch November 6, 2026 00:14
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