rails-secrets icon indicating copy to clipboard operation
rails-secrets copied to clipboard

Rails app gems unaware of `Rails.application` in config files; is nil

Open umdstu opened this issue 11 years ago • 1 comments

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?

umdstu avatar May 28 '14 13:05 umdstu

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

pixeltrix avatar Jun 06 '14 07:06 pixeltrix