From bfec6d249acc4b3a8885d18ccac7d8fa6b5c63df Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 9 Sep 2026 19:25:10 +0000 Subject: [PATCH 1/4] Add mutex_m to the Gemfile ahead of Ruby 3.4 Ruby 3.4 moved mutex_m out of the default gems and into the bundled gems. Bundled gems are not on the load path of a bundled application unless the Gemfile asks for them, so `require "mutex_m"` starts failing there. Something does require it: httpclient/auth.rb, and pusher depends on httpclient (~> 2.8). httpclient 2.8.3 is from 2016 and will not be fixing this. The way it fails is worth recording, because the message points nowhere near the cause. webmock's httpclient adapter wraps its `require "httpclient"` in a `rescue LoadError`, so the LoadError from auth.rb is swallowed -- but httpclient.rb requires auth.rb on line 19, before the rest of the class body, so `HTTPClient` is left half-defined. The adapter then subclasses it and dies on `alias_method :do_get_block_without_webmock, :do_get_block`: NameError: undefined method 'do_get_block' for class 'WebMockHTTPClient' That happens at `require "webmock"`, which config/application.rb reaches through Bundler.require, so all 63 spec files fail to load and the suite reports 0 examples. Nothing in the message mentions mutex_m, Ruby 3.4 or httpclient. Landing this before the Ruby bump rather than with it, per the plan's rule about bumping inside the compatibility overlap: mutex_m 0.3.0 works on 3.2.3 as well, so this commit is a no-op today and the next one does not have to carry an unrelated fix. Audited the rest of the extracted stdlib while here. Ruby 3.4 moved a dozen libraries to bundled gems; base64, bigdecimal, benchmark, csv, drb, logger, ostruct and racc are already explicit entries in the lockfile via Rails and Mongoid. The two other gems in the tree that reach for one are drb/observer.rb (`observer`) and cgi/session/pstore.rb (`pstore`), and neither file is loaded -- `require "drb"` and `require "cgi"` both succeed on 3.4.10 in this bundle, because cgi.rb's reference to pstore is inside a comment. Verified on Ruby 3.2.3: 324 examples, 0 failures; standardrb clean. The lockfile gains two lines and nothing else moves. Co-Authored-By: Claude Opus 5 (1M context) --- backend/Gemfile | 7 +++++++ backend/Gemfile.lock | 2 ++ 2 files changed, 9 insertions(+) diff --git a/backend/Gemfile b/backend/Gemfile index 2951a450..4fece5bf 100644 --- a/backend/Gemfile +++ b/backend/Gemfile @@ -48,6 +48,13 @@ gem "countries", require: "countries/global" # Pusher Client gem "pusher" +# Ruby 3.4 moved mutex_m from the default gems to the bundled gems, so it is no +# longer requirable from inside the bundle unless it is in the Gemfile. +# httpclient/auth.rb requires it, pusher requires httpclient, and the failure is +# a partially-defined HTTPClient class rather than a LoadError -- webmock +# swallows the LoadError and then dies aliasing a method that was never reached. +gem "mutex_m" + # ActiveRecord data translations gem "globalize", "~> 7.1" diff --git a/backend/Gemfile.lock b/backend/Gemfile.lock index 84c7b47d..3821fda7 100644 --- a/backend/Gemfile.lock +++ b/backend/Gemfile.lock @@ -283,6 +283,7 @@ GEM multi_json (1.15.0) multi_xml (0.6.0) multipart-post (2.4.1) + mutex_m (0.3.0) nearest_time_zone (0.0.4) andand kdtree @@ -546,6 +547,7 @@ DEPENDENCIES letter_opener mongoid (= 9.0.11) mongoid-rspec + mutex_m nearest_time_zone omniauth (~> 1.8) omniauth-facebook (~> 3.0) From 7f088fc1aae0d67182006b1f7435da0471a24418 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 9 Sep 2026 19:38:05 +0000 Subject: [PATCH 2/4] Upgrade to Ruby 3.4.10 Ruby 3.2 reached end of life on 2026-04-01, so the backend has been running unpatched since. 3.4 is the branch in normal maintenance that Rails 7.2 officially supports; going straight there rather than by way of 3.3.12 is what doing the Rails 7.2 bump first bought us, since Rails 7.1 never officially supported 3.4. Five files carry the version. `backend/.ruby-version` looks like a sixth, but it is a symlink to the root one and has been since the Ruby 3.0 upgrade, so the two cannot drift and one edit moves both. That is worth knowing because the upgrade plan flags them as separate files CI reads independently: the underlying trap was real, but it was the erb-lint job reading a different path than the others, and #889 fixed that by passing `working-directory: backend` to ruby/setup-ruby. No workflow file changes, deliberately. Every backend job resolves Ruby from `backend/.ruby-version` rather than a pinned `ruby-version:` input, so they pick this up on their own -- and touching .github/workflows/** would trigger the frontend and native job sets too, since all three workflows list it as a path filter. The lockfile moves by one line. `bundle lock` under 3.4.10 rewrote RUBY VERSION and re-resolved every gem to the same version it already had, which is the outcome to want here: no gem in the tree needed a bump to support 3.4. PLATFORMS stays `ruby`. The one Ruby 3.4 incompatibility in the tree was mutex_m, handled in the previous commit so this one is a version bump and nothing else. Verified on 3.4.10: 324 examples, 0 failures; standardrb, erblint and zeitwerk:check clean; boots in development, test and production; suite is unchanged at ~7s. Also ran the suite under `--yjit` (324 examples, 0 failures), because #907's defaults flip sets `config.yjit = true` and Ruby 3.4 is where that stops being inert -- `RubyVM::YJIT.enable` arrived in 3.3, and Rails guards the initializer on it. Note that Rails only enables YJIT if the interpreter was built with it; verify `RubyVM::YJIT.enabled?` on staging, since a Ruby without YJIT compiled in will silently skip it rather than complain. Heroku picks the version up from the Gemfile. Confirm the stack has 3.4.10 available before merging. Co-Authored-By: Claude Opus 5 (1M context) --- .ruby-version | 2 +- .tool-versions | 2 +- backend/Dockerfile | 2 +- backend/Gemfile | 2 +- backend/Gemfile.lock | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.ruby-version b/.ruby-version index b347b11e..84d6c676 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.2.3 +3.4.10 diff --git a/.tool-versions b/.tool-versions index 8ea25933..0b053141 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,5 +1,5 @@ nodejs 22.23.2 -ruby 3.2.3 +ruby 3.4.10 postgres 12.8 mongodb 4.4.9 redis 6.2.3 diff --git a/backend/Dockerfile b/backend/Dockerfile index 276ca765..746a44d1 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -1,4 +1,4 @@ -FROM ruby:3.2.3 +FROM ruby:3.4.10 # set working directory WORKDIR /app diff --git a/backend/Gemfile b/backend/Gemfile index 4fece5bf..8cfdfd05 100644 --- a/backend/Gemfile +++ b/backend/Gemfile @@ -1,6 +1,6 @@ source "https://rubygems.org" -ruby "3.2.3" +ruby "3.4.10" # Configuration management. keep on top of Gemfile gem "dotenv-rails", groups: %i[development test] diff --git a/backend/Gemfile.lock b/backend/Gemfile.lock index 3821fda7..a6513bc2 100644 --- a/backend/Gemfile.lock +++ b/backend/Gemfile.lock @@ -576,7 +576,7 @@ DEPENDENCIES webmock RUBY VERSION - ruby 3.2.3p157 + ruby 3.4.10p104 BUNDLED WITH 2.5.6 From a295908f1e099c0bb76863b5cb2b8511bc06712a Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 9 Sep 2026 19:38:36 +0000 Subject: [PATCH 3/4] Update pry-doc so it recognises Ruby 3.4 pry-doc ships the Ruby core documentation it serves, keyed by interpreter version, and 1.5.0 predates 3.4. It does not fail -- it prints ruby/3.4.10 isn't supported by this pry-doc version on stdout at every `require`, which means on every rails command, every boot and the head of every rspec run. 1.7.0 (2026-01-14) covers 3.4. Development and test group only, so the production bundle is unaffected. The resolve is conservative: pry-doc 1.5.0 -> 1.7.0 and its yard floor from ~> 0.9.11 to ~> 0.9.21, which the locked yard 0.9.44 already satisfies. Nothing else in the lockfile moves. Separate from the version bump because it is the only gem the Ruby upgrade forced, and a reviewer should be able to see the bump on its own. Verified: 324 examples, 0 failures on 3.4.10, and the warning is gone from both `rails runner` and rspec output. Co-Authored-By: Claude Opus 5 (1M context) --- backend/Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/Gemfile.lock b/backend/Gemfile.lock index a6513bc2..1d12e08f 100644 --- a/backend/Gemfile.lock +++ b/backend/Gemfile.lock @@ -332,9 +332,9 @@ GEM pry-byebug (3.10.1) byebug (~> 11.0) pry (>= 0.13, < 0.15) - pry-doc (1.5.0) + pry-doc (1.7.0) pry (~> 0.11) - yard (~> 0.9.11) + yard (~> 0.9.21) pry-rails (0.3.11) pry (>= 0.13.0) public_suffix (7.0.5) From 7068a1916e97c83012ca887dcc80e6aed00fc3a2 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 9 Sep 2026 19:38:51 +0000 Subject: [PATCH 4/4] Update the docs for Ruby 3.4.10 README.md's environment list and the one-line description of `backend/` in CLAUDE.md both name the Ruby version, and both were stale. CLAUDE.md also still said Rails 7.1, which #907 missed. Corrected here rather than left for later, since it is the same line and the same class of mistake. The PostgreSQL 12.8 and MongoDB 4.4.9 entries in README.md are accurate -- those are what docker-compose.yml and CI actually run -- so they stay as they are. Both are past end of life and the upgrade plan tracks them as their own piece of work. Co-Authored-By: Claude Opus 5 (1M context) --- CLAUDE.md | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index f6ea7157..f29b0a76 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -4,7 +4,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co Flaredown is a chronic-illness symptom tracker. It is a monorepo with three deployable apps: -- `backend/` — Rails 7.1 API (Ruby 3.2.3), the only backend for all clients. +- `backend/` — Rails 7.2 API (Ruby 3.4.10), the only backend for all clients. - `frontend/` — Ember.js 2.18 web app (the production web client at app.flaredown.com), proxies API calls to the backend. - `native/` — Expo / React Native + TypeScript app (newer, in-progress replacement for the Ember client). diff --git a/README.md b/README.md index deba00d4..21fb57d3 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Help would be appreciated! Please join us in [slack #flaredown](https://join.sla * PostgreSQL 12.8 * MongoDB 4.4.9 * Redis 6.2.3 -* Ruby 3.2.3 +* Ruby 3.4.10 * Node 22 (the frontend supports Node 18 and newer; `frontend/.nvmrc` pins the version CI builds against) ## Installation