echo echo - 1 year ago 75
Ruby Question

Figaro "undefined method `require_keys' for Figaro:Module (NoMethodError)"

In my


I put:


but got the following when running
rails s

/Users/guycao/code/oms_on_rails/config/initializers/figaro.rb:1:in `<top (required)>': undefined method `require_keys' for Figaro:Module (NoMethodError)
from /Users/guycao/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.2/lib/active_support/dependencies.rb:241:in `load'
from /Users/guycao/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.2/lib/active_support/dependencies.rb:241:in `block in load'
from /Users/guycao/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.2/lib/active_support/dependencies.rb:232:in `load_dependency'
from /Users/guycao/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.2/lib/active_support/dependencies.rb:241:in `load'


Here are my configs:
Figaro version - 0.7.0

Ruby version - ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin13.0]

Rails version - 4.1.2

For your information, the environmental variable does exist in the

but even if it didn't exist, it shouldn't complain about not being able to find the

Am I missing something? I tried
require "figaro"

Answer Source

Figaro.require_keys was added in version 1.0. It was previously called Figaro.require. Either upgrade figaro to 1.x or use the require method.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download