rails-secrets
rails-secrets copied to clipboard
Rails app gems unaware of `Rails.application` in config files; is nil
After implementing this gem and the required changes, I verified everything worked. I then added a custom gem to the Gemfile that happens to load one of the config/*.yml files. As expected, the yml file has <%= Rails.application.secrets.key_name %>
but when the gem tries to load the yml, It errors:
undefined method `secrets' for nil:NilClass (NoMethodError)
Is there a way to make the gem aware of Rails.application?
The only way I can think of is you need to load Rails before the gem tries to load the YAML file - without seeing the Gemfile, etc it's hard to say whether it's possible