我有一个奇怪的情况,我不太明白。
当我运行我的规格时,rspec spec
它们都通过了。但是,截至今天,当我运行警卫并调用规范时,它崩溃并出现以下错误:
.../.rvm/gems/ruby-1.9.2-p180@fourth_env/gems/activerecord-3.1.1/lib/active_record/base.rb:1088:in `method_missing': undefined method `geocoded_by' for #<Class:0x00000104fae240> (NoMethodError)
现在,违规行在我的应用程序photo.rb
模型中:
geocoded_by :location, :latitude => :lat, :longitude => :lng
这是调用geocoder
插件,它列在我的 gemfile 和我的 gemset 的一部分等中。我重新运行了 bundler 以仔细检查这一点。
无论我跑rspec spec
还是bundle exec rspec spec
一切都通过了,无论我跑guard
还是bundle exec guard
失败。
我真的很困惑为什么在直接运行规范时运行规范时会出现错误。有没有人遇到过这样的错误?