Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Mysql2: uninitialized constant ActiveRecord::ConnectionAdapters::Mysql2Column #33

Open
canavese opened this issue Dec 29, 2011 · 5 comments

Comments

@canavese
Copy link

Unfortunately, it appears that the newest versions of ActiveRecord (3.2.0.rc1, at least) use:
ActiveRecord::ConnectionAdapters::Mysql2Adapter::Column

gems/spatial_adapter-1.2.0/lib/spatial_adapter/mysql2.rb:83:in <module:ConnectionAdapters>': uninitialized constant ActiveRecord::ConnectionAdapters::Mysql2Column (NameError) from gems/spatial_adapter-1.2.0/lib/spatial_adapter/mysql2.rb:82:inmodule:ActiveRecord'
from gems/spatial_adapter-1.2.0/lib/spatial_adapter/mysql2.rb:81:in <top (required)>' from gems/bundler-1.0.21/lib/bundler/runtime.rb:68:inrequire'

@descentintomael
Copy link

This is because of the ActiveRecord commit here: rails/rails@5766539#activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb

I've created a fork to fix this here: https://github.com/descentintomael/spatial_adapter

I'm still working on figuring out the :option => "ENGINE=MyISAM" thing though. For whatever reason InnoDB isn't liking the spatial extensions.

@descentintomael
Copy link

Solution! I really should have waited on that previous comment:

In your migration for creating the table you want spatial extensions on replace

create_table :my_table_name do |t|

with

create_table(:my_table_name, :options => 'ENGINE=MyISAM') do |t|

@RyanNaughton
Copy link

descentintomael, can you submit your pull request to the fagility/spatial_adapter repo? It would be great to have this fix in the main repo as you previously submitted a pull request to a random forked repo instead. Thanks!

@descentintomael
Copy link

Done. Thanks for reminding me.

@dzimmermann1983
Copy link

I dont really get it. Is it fixed right now with InnoDB too?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants