4

I am trying to get started with Geokit, and I ran the install command and was greeted with the following:

rails g geokit_rails:install
Could not find generator geokit_rails:install.

Any idea what's going on? I am so confused. bundle install works just fine. I run bundle exec rake db:migrate. but when I go into the console, when I try require 'geokit', I get false. I assume it's because the config file is missing? But how do I generate a sample config file to modify if the install script is failing??

Ringo Blancke
  • 2,444
  • 6
  • 30
  • 54

1 Answers1

10

The problem is that your version of the geokit-rails gem does not contain the generator. It was added with https://github.com/geokit/geokit-rails/commit/bb4261acef62a26de823c4b7306634ffb7c3381f. The latest version of the gem is 2.1.0, and as you can see here, the generators were not part of that release.

If you want to use the head version of the gem, then you can change your Gemfile to match gem 'geokit-rails', github: 'geokit/geokit-rails'.

Sean Hill
  • 14,978
  • 2
  • 50
  • 56
  • sorry one last bit of help! this works perfectly, but how do I use Geokit through rails console? I tried require 'geokit', require 'geokit-rails', both returned false. everything else is setup. btw, I didn't change the config file at all (though it has been generated) – Ringo Blancke May 08 '15 at 03:46
  • They're already included by the `Gemfile`. You should be able to add the functionality to your models, i.e. `acts_as_mappable`... or do things like `Geokit::Geocoders::GoogleGeocoder.geocode("Some location")` – Sean Hill May 08 '15 at 03:49