From 968a712f135d7e64e187945ab2b00cd0a0f100aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20V=C3=A1squez?= Date: Mon, 20 Jul 2026 11:51:12 -0600 Subject: [PATCH] Add ostruct gem to fix production boot on Ruby 3.4 Production (points-production) is crashing on boot with: madmin-1.2.8/lib/madmin/resource.rb:39:in 'attribute': uninitialized constant OpenStruct (NameError) Ruby 3.4 removed ostruct from the default gems (it is now a bundled gem that must be declared in the Gemfile). madmin 1.2.8 uses OpenStruct without requiring "ostruct", so on Ruby 3.4 the constant is undefined, Puma fails to boot, and every request returns 503 (H10 App crashed). madmin's rescue in resource.rb re-raises the NameError as a misleading "couldn't find attribute 'id'" ArgumentError, which masks the real cause. Declaring gem "ostruct" makes Bundler.require load it at boot so OpenStruct is defined. Applied to Gemfile.lock and Gemfile.next.lock. This is a hotfix to restore production; the madmin 2.x upgrade (#371) is the longer-term fix and removes the incompatibility entirely. --- Gemfile | 2 ++ Gemfile.lock | 2 ++ Gemfile.next.lock | 1 + 3 files changed, 5 insertions(+) diff --git a/Gemfile b/Gemfile index fd18f501..4649a364 100644 --- a/Gemfile +++ b/Gemfile @@ -108,4 +108,6 @@ gem "coffee-script" gem "pundit", "~> 2.2" +gem "ostruct" + gem "madmin", "~> 1.2" diff --git a/Gemfile.lock b/Gemfile.lock index afb692a8..f41e8fc5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -273,6 +273,7 @@ GEM actionpack (>= 4.2) omniauth (~> 2.0) orm_adapter (0.5.0) + ostruct (0.6.3) pagy (6.1.0) parallel (2.1.0) parser (3.3.12.0) @@ -526,6 +527,7 @@ DEPENDENCIES newrelic_rpm next_rails ombu_labs-auth + ostruct pg puma (~> 7.2) pundit (~> 2.2) diff --git a/Gemfile.next.lock b/Gemfile.next.lock index f30b1160..aa80cf62 100644 --- a/Gemfile.next.lock +++ b/Gemfile.next.lock @@ -564,6 +564,7 @@ DEPENDENCIES newrelic_rpm next_rails ombu_labs-auth + ostruct pg puma (~> 7.2) pundit (~> 2.2)