Skip to content

Add ostruct gem to fix production boot on Ruby 3.4#372

Merged
JuanVqz merged 1 commit into
mainfrom
fix/ostruct-boot
Jul 20, 2026
Merged

Add ostruct gem to fix production boot on Ruby 3.4#372
JuanVqz merged 1 commit into
mainfrom
fix/ostruct-boot

Conversation

@JuanVqz

@JuanVqz JuanVqz commented Jul 20, 2026

Copy link
Copy Markdown
Member

Hotfix: restore production boot on Ruby 3.4

Production (points-production) is down. Puma crashes on boot and every request returns 503 (H10 App crashed).

Root cause

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 require "ostruct", so on Ruby 3.4 the constant is undefined, boot fails, and the app crashes.

madmin's rescue in resource.rb re-raises the NameError as a misleading ArgumentError: couldn't find attribute 'id' on Estimate model, which masks the real cause in the logs.

Fix

Declare gem "ostruct" so Bundler.require loads it at boot and OpenStruct is defined. Applied to both Gemfile.lock and Gemfile.next.lock.

Scope

Minimal, reversible hotfix to get production back up. The madmin 2.x upgrade (#371) is the longer-term fix and removes this incompatibility entirely.

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.
@JuanVqz
JuanVqz temporarily deployed to points-production July 20, 2026 17:52 Inactive
@JuanVqz
JuanVqz merged commit f3f44bb into main Jul 20, 2026
2 checks passed
@JuanVqz
JuanVqz deleted the fix/ostruct-boot branch July 20, 2026 17:55
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