From 6b0c879806ff7b181d670a638855818de060482a Mon Sep 17 00:00:00 2001 From: Ed Davey Date: Thu, 5 Dec 2024 14:14:03 +0000 Subject: [PATCH] Play past OpenStruct loading issue with global 'require' We've been seeing "uninitialize constant" errors for OpenStruct like ``` uninitialized constant ProjectHelper::OpenStruct ``` which we only see the deployed environments, not in local development or in CI. This appears to be a file/class/module loading problem which occurs after unrelated changes to the codebase. To play past this issue we now explictly `require "ostruct"` from the main `application.rb` file. --- config/application.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/application.rb b/config/application.rb index 62d79216d..1f4fcfd6f 100644 --- a/config/application.rb +++ b/config/application.rb @@ -1,5 +1,7 @@ require_relative "boot" +require "ostruct" + require "rails" # Pick the frameworks you want: require "active_model/railtie"