alexreisner/geocoder — Issue #137: Geocoder seems to crash specs when run via guard, but not when specs are run directly?
Author: burlesona
Created: 2011-10-26 16:53:29+00:00
State: open

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 # (NoMethodError)

Now, the offending line is in my app's `photo.rb` model:

geocoded_by :location, :latitude => :lat, :longitude => :lng

`geocoder` 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.

My app has never had issues with geocoder in the past.

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?