Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uninitialized constant RGeo::ActiveRecord::DEFAULT_SPATIAL_COLUMN_CONSTRUCTORS #7

Closed
jtrees opened this issue Nov 7, 2017 · 3 comments

Comments

@jtrees
Copy link

jtrees commented Nov 7, 2017

I wanted to give this adapter a go but am having issues when creating a spatial column in a migration.

This is my code:

class AddLocationCoordinatesToAds < ActiveRecord::Migration[5.1]
  def change
    add_column :ads, :latlon, :point, null: false
  end
end

This yields the following:

$ rails db:migrate
== 20171107155741 AddLocationCoordinatesToAds: migrating ======================
-- add_column(:ads, :latlon, :point, {:null=>false})
rails aborted!
StandardError: An error has occurred, all later migrations canceled:

uninitialized constant RGeo::ActiveRecord::DEFAULT_SPATIAL_COLUMN_CONSTRUCTORS
/home/xxxx/.rvm/gems/ruby-2.4.2@xxxx/gems/activerecord-mysql2rgeo-adapter-2.0.1/lib/active_record/connection_adapters/mysql2rgeo/schema_statements.rb:20:in `spatial_column_constructor'

More info:

activerecord-mysql2rgeo-adapter 2.0.1
ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-linux]
rails 5.1.4
rgeo 0.6.0
rgeo-activerecord 5.1.1
mysql 5.7.20
@stadia
Copy link
Owner

stadia commented Nov 8, 2017

sorry !

removed DEFAULT_SPATIAL_COLUMN_CONSTRUCTORS in rgeo-activerecord 5.1.1
rgeo/rgeo-activerecord@bc89717

you should be to use version 5.1.0

@jtrees
Copy link
Author

jtrees commented Nov 15, 2017

Thanks! I'm unable to test this for now though.

@stadia
Copy link
Owner

stadia commented Dec 12, 2017

update 2.0.3
remove dependency problem
rgeo-activerecord ~> 5.1

@stadia stadia closed this as completed Dec 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants