required 'rgeo-activerecord' but t.point still not recognized

82 views
Skip to first unread message

Chris Davaz

unread,
Oct 27, 2014, 10:04:30 PM10/27/14
to rgeo-...@googlegroups.com
I have required 'rgeo-activerecord' before running migrations, however I am getting:

undefined method `point' for #<ActiveRecord::ConnectionAdapters::TableDefinition:0x007fa066527a48>/Users/cdavaz/.rvm/gems/ruby-2.1.3@buzz/gems/rgeo-activerecord-1.2.0/lib/rgeo/active_record/common_adapter_elements.rb:61:in `method_missing_with_rgeo'

I took a look at the code here:

https://github.com/rgeo/rgeo-activerecord/blob/master/lib/rgeo/active_record/common_adapter_elements.rb#L53

and @base is nil causing method_missing_without_rgeo to be called on line 61. The line that creates the column in my migrations is:

t.point :geo, null: false

Chris Davaz

unread,
Oct 28, 2014, 2:59:35 PM10/28/14
to rgeo-...@googlegroups.com
Update:

I got this working by using the activerecord-mysql2spatial-adapter gem and setting my adapter to 'mysql2spatial', however this gem depends on a very old version of rgeo-activerecord (0.4.6) so I'm a bit confused. I'm using AR 4.1.6 so I would have figured I need the latest rgeo-activerecord (1.2.0). Any advice on how to get things working with rgeo-activerecord 1.2.0 would be greatly appreciated.
Reply all
Reply to author
Forward
0 new messages