pennylane-hq / activerecord-adapter-redshift

Other
6 stars 26 forks source link

uninitialized constant ActiveRecord::ConnectionAdapters::AbstractAdapter::SchemaCreation (NameError) #2

Closed jkhulme closed 2 years ago

jkhulme commented 2 years ago

Hi,

I just tried to use this gem after upgrading from rails 6 to rails 7 and got the following error:

/app/vendor/bundle/ruby/3.1.0/gems/activerecord7-redshift-adapter-1.1.0/lib/active_record/connection_adapters/redshift/schema_statements.rb:4:in `<module:Redshift>': uninitialized constant ActiveRecord::ConnectionAdapters::AbstractAdapter::SchemaCreation (NameError)

      class SchemaCreation < AbstractAdapter::SchemaCreation
                                            ^^^^^^^^^^^^^^^^
Did you mean?  ActiveRecord::SchemaMigration

We are using: ruby 3.1.1p18 rails/active-record 7.0.2.4

tdeo commented 2 years ago

Hello @jkhulme, it seems from the backtrace that you're not actually using this fork (which adds compatibility with Rails 7).

I'm seeing that from the backtrace which mentions version 1.1.0 (this fork only has 1.0.0) and the fact that the line isn't the same as the repo.

Does your Gemfile actually say gem 'activerecord7-redshift-adapter', github: 'pennylane-hq/activerecord7-redshift-adapter' and have you run bundle install ?

aleksclark commented 2 years ago

Just encountered this myself. FWIW I think it's rather surprising behavior as I would have expected gem 'activerecord7-redshift-adapter' to work - it's what the README says and it has activerecord7 in the name.

tdeo commented 2 years ago

This is actually a fork from the fork and we kept the README as it was, just updated it to contain more accurate information, please let me know if that solves your issues @jkhulme and @aleksclark

aleksclark commented 2 years ago

It did, thanks a lot. Sorry to hassle - github shows it as a fork of the activerecord6 gem so I figured you owned the original. Thanks for making this work on AR7!

tdeo commented 2 years ago

You're welcome! I'm closing this since it's now resolved