TypeError: can't quote RGeo::Cartesian::PolygonImpl

61 views
Skip to first unread message

Adam TTN

unread,
Oct 2, 2018, 9:23:47 AM10/2/18
to RGeo-Users
This is my gemfile rails & rgeo setup:

gem 'rails', '~> 5.2.0'
gem 'mysql2', '~> 0.5.2'
...
gem
'rgeo', '1.0.0'
gem 'rgeo-activerecord', '~> 6.0.0'
gem 'activerecord-mysql2rgeo-adapter', '2.2.0'


This is how table has been created:

class Create Zones < ActiveRecord::Migration[5.2]
  def change
    create_table :zones do |t|
      t.string  :name,        null: false
      t.integer :external_id
      t.polygon :internal_polygon
    end
  end
end


I have sth like this in schema.rb:

# Could not dump table "zones" because of following NameError
#   uninitialized constant ActiveRecord::ConnectionAdapters::Mysql2RgeoAdapter::INDEX_TYPES



This is what I'm trying to create and save data:

z = Zone.new
z.internal_polygon = RGeo::Cartesian.factory(:srid => 4326).parse_wkt("POLYGON((10 10,20 10,20 20,10 20,10 10))")
z.valid? # true
z.save # TypeError: can't quote RGeo::Cartesian::PolygonImpl from (irb):16



What can I do with that? 
Reply all
Reply to author
Forward
0 new messages