2015-02-21 06:08:02

NoMethodError: undefined method `spatial' using rgeo and activerecord-mysql2spatial-adapter

Are you experiencing the error below? Well, so was I. It appears that the schema.rb is not correctly generated and you will have to change that manually.

NoMethodError: undefined method `spatial' for #
/home/rails/vendor/bundle/ruby/2.1.0/gems/rgeo-activerecord-0.4.6/lib/rgeo/active_record/common_adapter_elements.rb:105:in `method_missing'

Look in your schema.rb and find a line similar to
t.spatial "latlon", limit: {:type=>"point"}

Change it to
t.column "latlon", :point, null: false