justinraczak
justinraczak

Reputation: 786

Rails & Geokit - config: Undefined method api_key= for Geokit::Geocoders::GoogleGeocoder:Class (NoMethodError)

I've set up geokit and geokit-rails and for the most part everything is working. I'm now hitting some 'too many queries' issues during development and I suspect the culprit may be not providing an api_key to the Google Geocoder API. I set up a geokit_config.rb as described in the README, but get an error on providing an api_key to Google.

....geokit_config.rb:33:in `<top (required)>': undefined method `api_key=' for Geokit::Geocoders::GoogleGeocoder:Class (NoMethodError)

Tried tinkering with a few different things but haven't had any luck. I've exhausted any related posts on Google and SO and haven't found anything there. Even tried overriding the google.rb module with an explicit setter for self.api_key. No luck. Anyone have any ideas?

Upvotes: 0

Views: 502

Answers (1)

roo
roo

Reputation: 7196

The README is for 1.8.5 which includes support for Google's public API (https://github.com/geokit/geokit/commit/2bc71d541b0983372e34fdf1fedb0b2bea2fb76b)

However the published version is 1.8.4 which does not support the public API

You can fix this by pulling master directly from github until 1.8.5 is published.

gem 'geokit', branch: 'master', git: 'https://github.com/geokit/geokit.git'

Upvotes: 2

Related Questions