chamber: undefined method `env' for Chamber:Module - Rails 6

Current Behavior

Trying to use Chamber in a Rails initializer and the Rails application will not boot.

	 2: from /Users/patrickveverka/Code/personal/blah/config/application.rb:9:in `<main>'
	 1: from /Users/patrickveverka/Code/personal/blah/config/application.rb:11:in `<module:Blah>'
/Users/patrickveverka/Code/personal/blah/config/application.rb:14:in `<class:Application>': private method `load' called for Chamber:Module (NoMethodError)

Steps to Reproduce

  1. Create a new Rails app (rails new blah)
  2. Add gem "chamber" to Gemfile
  3. bundle install
  4. Add call to Chamber.env.setting in an initializer
  5. Run local server rails s
  6. App go boom

Expected Behavior

I thought that the chamber secrets would be available in initializers (devise, mailer, etc)

Environment

  • OS:

    • Windows
    • macOS
    • iOS
    • Android
    • Linux
    • Other
  • OS Version: 10.15.6 (Catalina)

I made an example app at https://github.com/veverkap/chamber_error that shows the error at boot. I included the private keys in the repo but will destroy it later.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 21

Most upvoted comments

Worked on this a bit but didn’t quite get there, but I’m on it.

Also sorry it took so long for me to see this!