Search code examples
ruby-on-rails-3geokit

undefined method `acts_as_mappable' trying to use geokit


I am trying to use geokit but I get the following message:

undefined method `acts_as_mappable'

I have tried the following solutions but nothing has worked so far: Rails 3.1.0, geokit, with error acts_as_mappable

I am using rails 3.0.1 and ruby 1.9.2

I have followed the instructions here https://github.com/jlecour/geokit-rails3 but its not working

This is my model:

class Event < ActiveRecord::Base

acts_as_mappable :default_units => :kms,
         :default_formula => :flat

end

and I have this in my gemfile

gem 'geokit-rails3'

I also have the folder vendor, inside I have a geokit-rails3 folder with the files, one of them named acts_as_mappable. I have tried adding require 'geokit-rails3' in the top of my model but it says no file to load.

I tried both, installing it as a plugin:
rails plugin install git://github.com/jlecour/geokit-rails3.git and also by doing gem install (and it is shown when I list all the gems installed)

Any help is greatly appreciated.


Solution

  • The problem was solved by reinstalling rails with:

    sudo apt-get install rails rails-doc rails-ruby1.8