0

I'm working with Rails 3.2 and MySQL. I installed the gems:

gem 'rgeo', '0.3.20'  
gem 'rgeo-activerecord', '0.4.6'
gem 'activerecord-mysql2spatial-adapter', '0.4.3'

all other requirements and dependencies are met, or at least I think so. Yet, following the suggested procedure for creating a model with spatial data in it (here), step-by-step, when I run this migration:

class CreateLocations < ActiveRecord::Migration
  def change
    create_table :locations do |t|
      t.string :name
      t.point :latlon
      t.timestamps
    end
  end
end

I get the error:

undefined method 'point' for #/.../.rvm/gems/ruby-1.9.3-p484/gems/rgeo-activerecord-0.4.6/lib/rgeo/active_record/common_adapter_elements.rb:105:in 'method_missing'

Anyone knows about this?

Miotsu
  • 1,776
  • 18
  • 30

1 Answers1

2

Change

t.point :latlon

to

t.column :latlon, :point, :null => false
pcasa
  • 3,710
  • 7
  • 39
  • 67