Rails 3.1.0, geokit, with error acts_as_mappable

前端 未结 1 1604
一整个雨季
一整个雨季 2021-01-25 15:50

I am getting the

undefined local variable or method `acts_as_mappable\'

error when using geokit, and after tons of Goggling and attempts, I ca

相关标签:
1条回答
  • 2021-01-25 16:50

    Okay - Here is the solution for anyone that needs help on how I got it to work...

    Make sure your project Gemfile does not contain any geokit info of any kind.

    install geokit

    > gem install geokit
    
    > gem list geo
    *** LOCAL GEMS ***
    geokit (1.6.0, 1.5.0)
    

    uninstall geokit-rails3 and geokit-rails31

    > gem uninstall geokit-rails31 geokit-rails3
    

    in your project, at the root level:

    > rails plugin install git://github.com/jlecour/geokit-rails3.git
    

    edit the spec

    > vi vendor/plugins/geokit-rails3/geokit-rails3.gemspec
    

    change rails dependency line to be

    s.add_runtime_dependency 'rails', '>= 3.1.0'
    

    now, edit the Gemfile to include the gem

    gem 'geokit-rails3', :path => 'vendor/plugins/geokit-rails3'
    

    Note, the Gemfile only contains an entry for the geokit-rails3, and no entries for normal geokit gem. i.e. there is not a "gem 'geokit', '>= 1.5.0'" entry

    then in your application root, do a

    bundle install
    

    It should be setup, and you can now follow a typical tutorial - as described in the git instructions

    https://github.com/jlecour/geokit-rails3
    
    0 讨论(0)
提交回复
热议问题