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

Rails 6.1.6.1 no longer loading Settings in /config/environments/*.rb #230

Open
cweilemann opened this issue Jul 26, 2022 · 1 comment
Open

Comments

@cweilemann
Copy link

Hey @huacnlee - I'm upgrading an app (slowly) to Rails 7, and in Rails 6.1.6.1, I'm getting the following error

/Users/cweilemann/Projects/app/config/environments/production.rb:99:in `block in <top (required)>': uninitialized constant Setting (NameError)
Did you mean?  String

This didn't happen in Rails 5. I'm using the zeitwork gem. I checked the Rails Guide for Autoloading and Reloading Constants but that didn't help. Any suggestions?

@tjku
Copy link

tjku commented Aug 23, 2022

@cweilemann The answer is here: https://github.com/huacnlee/rails-settings-cached#readonly-field

# You must require_relative directly in Rails 6.1+ in config/environments/production.rb
require_relative "../../app/models/setting"

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

No branches or pull requests

2 participants