Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Play past OpenStruct loading issue with global 'require' #2022

Merged
merged 2 commits into from
Dec 5, 2024

Conversation

edavey
Copy link
Collaborator

@edavey edavey commented Dec 5, 2024

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.

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.
… issue"

This reverts commit 5f3b67d.

This is now fixed generally by requiring OpenStruct in the main
`application.rb` file:

```
require "ostruct"
```
Copy link

sonarqubecloud bot commented Dec 5, 2024

@edavey edavey merged commit 8bfba67 into main Dec 5, 2024
10 checks passed
@edavey edavey deleted the fix/require-openstruct-globally branch December 5, 2024 15:07
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.

2 participants