我目前在为我的 Rails 4 应用程序配置 Figaro 时遇到问题。每当我尝试运行 RSpec 或 rake db:migrate 时,都会遇到以下错误:
method_missing': undefined method
{}:Figaro::Env 的 aws_access_key'
以下是完整的错误消息供参考:
Louiss-MacBook-Pro:beautifulnow louismedina$ rspec
/Users/louismedina/.rvm/gems/ruby-2.1.5@beautifulnow-rails4/gems/figaro-0.7.0/lib/figaro/env.rb:9:in `method_missing': undefined method `aws_access_key' for #<Figaro::Env:0x007fc1b17749d8> (NoMethodError)
from /Users/louismedina/Desktop/MindtonicMedia/beautifulnow/config/initializers/aws.rb:1:in `<top (required)>'
from /Users/louismedina/.rvm/gems/ruby-2.1.5@beautifulnow-rails4/gems/activesupport-4.0.13/lib/active_support/dependencies.rb:223:in `load'
from /Users/louismedina/.rvm/gems/ruby-2.1.5@beautifulnow-rails4/gems/activesupport-4.0.13/lib/active_support/dependencies.rb:223:in `block in load'
from /Users/louismedina/.rvm/gems/ruby-2.1.5@beautifulnow-rails4/gems/activesupport-4.0.13/lib/active_support/dependencies.rb:214:in `load_dependency'
from /Users/louismedina/.rvm/gems/ruby-2.1.5@beautifulnow-rails4/gems/activesupport-4.0.13/lib/active_support/dependencies.rb:223:in `load'
from /Users/louismedina/.rvm/gems/ruby-2.1.5@beautifulnow-rails4/gems/railties-4.0.13/lib/rails/engine.rb:609:in `block (2 levels) in <class:Engine>'
from /Users/louismedina/.rvm/gems/ruby-2.1.5@beautifulnow-rails4/gems/railties-4.0.13/lib/rails/engine.rb:608:in `each'
from /Users/louismedina/.rvm/gems/ruby-2.1.5@beautifulnow-rails4/gems/railties-4.0.13/lib/rails/engine.rb:608:in `block in <class:Engine>'
from /Users/louismedina/.rvm/gems/ruby-2.1.5@beautifulnow-rails4/gems/railties-4.0.13/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/louismedina/.rvm/gems/ruby-2.1.5@beautifulnow-rails4/gems/railties-4.0.13/lib/rails/initializable.rb:30:in `run'
from /Users/louismedina/.rvm/gems/ruby-2.1.5@beautifulnow-rails4/gems/railties-4.0.13/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/louismedina/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/tsort.rb:226:in `block in tsort_each'
from /Users/louismedina/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
from /Users/louismedina/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/tsort.rb:418:in `block (2 levels) in each_strongly_connected_component_from'
from /Users/louismedina/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/tsort.rb:427:in `each_strongly_connected_component_from'
from /Users/louismedina/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/tsort.rb:417:in `block in each_strongly_connected_component_from'
from /Users/louismedina/.rvm/gems/ruby-2.1.5@beautifulnow-rails4/gems/railties-4.0.13/lib/rails/initializable.rb:44:in `each'
from /Users/louismedina/.rvm/gems/ruby-2.1.5@beautifulnow-rails4/gems/railties-4.0.13/lib/rails/initializable.rb:44:in `tsort_each_child'
from /Users/louismedina/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/tsort.rb:411:in `call'
from /Users/louismedina/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/tsort.rb:411:in `each_strongly_connected_component_from'
from /Users/louismedina/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/tsort.rb:347:in `block in each_strongly_connected_component'
from /Users/louismedina/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/tsort.rb:345:in `each'
from /Users/louismedina/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/tsort.rb:345:in `call'
from /Users/louismedina/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/tsort.rb:345:in `each_strongly_connected_component'
from /Users/louismedina/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/tsort.rb:224:in `tsort_each'
from /Users/louismedina/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/tsort.rb:205:in `tsort_each'
from /Users/louismedina/.rvm/gems/ruby-2.1.5@beautifulnow-rails4/gems/railties-4.0.13/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/louismedina/.rvm/gems/ruby-2.1.5@beautifulnow-rails4/gems/railties-4.0.13/lib/rails/application.rb:215:in `initialize!'
from /Users/louismedina/.rvm/gems/ruby-2.1.5@beautifulnow-rails4/gems/railties-4.0.13/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /Users/louismedina/Desktop/MindtonicMedia/beautifulnow/config/environment.rb:5:in `<top (required)>'
from /Users/louismedina/Desktop/MindtonicMedia/beautifulnow/spec/spec_helper.rb:3:in `require'
from /Users/louismedina/Desktop/MindtonicMedia/beautifulnow/spec/spec_helper.rb:3:in `<top (required)>'
from /Users/louismedina/Desktop/MindtonicMedia/beautifulnow/spec/controllers/admin/admin_controller_spec.rb:1:in `require'
from /Users/louismedina/Desktop/MindtonicMedia/beautifulnow/spec/controllers/admin/admin_controller_spec.rb:1:in `<top (required)>'
from /Users/louismedina/.rvm/gems/ruby-2.1.5@beautifulnow-rails4/gems/rspec-core-2.14.7/lib/rspec/core/configuration.rb:896:in `load'
from /Users/louismedina/.rvm/gems/ruby-2.1.5@beautifulnow-rails4/gems/rspec-core-2.14.7/lib/rspec/core/configuration.rb:896:in `block in load_spec_files'
from /Users/louismedina/.rvm/gems/ruby-2.1.5@beautifulnow-rails4/gems/rspec-core-2.14.7/lib/rspec/core/configuration.rb:896:in `each'
from /Users/louismedina/.rvm/gems/ruby-2.1.5@beautifulnow-rails4/gems/rspec-core-2.14.7/lib/rspec/core/configuration.rb:896:in `load_spec_files'
from /Users/louismedina/.rvm/gems/ruby-2.1.5@beautifulnow-rails4/gems/rspec-core-2.14.7/lib/rspec/core/command_line.rb:22:in `run'
from /Users/louismedina/.rvm/gems/ruby-2.1.5@beautifulnow-rails4/gems/rspec-core-2.14.7/lib/rspec/core/runner.rb:80:in `run'
from /Users/louismedina/.rvm/gems/ruby-2.1.5@beautifulnow-rails4/gems/rspec-core-2.14.7/lib/rspec/core/runner.rb:17:in `block in autorun'
有人对此有任何指导吗?谢谢。