规格直接运行时通过,但在 Guard 中运行时崩溃
我有一个奇怪的情况,我不太明白。
当我使用 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 等的一部分中。我重新运行捆绑器来仔细检查这一点。
无论我运行rspec spec
还是bundle exec rspec spec
,它都会通过,无论我运行guard
还是bundle execguard
> 它失败了。
我真的很困惑为什么在保护下运行规范时会出现错误,而直接运行规范时不会出现错误。以前有人遇到过这样的错误吗?
I have a strange situation I can't quite understand.
When I run my specs with rspec spec
they all pass. However, as of today, when I run guard and it calls the specs, it crashes with the following error:
.../.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)
Now, the offending line is in my app's photo.rb
model:
geocoded_by :location, :latitude => :lat, :longitude => :lng
This is calling the geocoder
plugin, which is listed in my gemfile and part of my gemset etc. I re-ran bundler to double check this.
Whether I run rspec spec
or bundle exec rspec spec
it all passes, and whether I run guard
or bundle exec guard
it fails.
I'm really baffled as to why there would be an error when running specs under guard that isn't present when running specs directly. Has anyone ever encountered an error like this before?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论