sportdb / sport.db

sport.db - open sports database (e.g. football.db, formula1.db etc.) command line tool and libraries
Creative Commons Zero v1.0 Universal
221 stars 29 forks source link

Directly inheriting from ActiveRecord::Migration is not supported error when executing sportdb CLI #6

Closed scottwhudson closed 6 years ago

scottwhudson commented 7 years ago

I just ran gem install sportdb and the gem built just fine. However, when running sportdb I get the following error:

$ sportdb
activerecord-utils/0.4.0 (activerecord/5.1.2) on Ruby 2.3.3 (2016-11-21) [x86_64-darwin16]
/Users/swh/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activerecord-5.1.2/lib/active_record/migration.rb:525:in `inherited': Directly inheriting from ActiveRecord::Migration is not supported. Please specify the Rails release the migration was written for: (StandardError)

  class ConfDb::CreateDb < ActiveRecord::Migration[4.2]
    from /Users/swh/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/props-activerecord-0.1.0/lib/props/activerecord/schema.rb:5:in `<module:ConfDb>'
    from /Users/swh/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/props-activerecord-0.1.0/lib/props/activerecord/schema.rb:3:in `<top (required)>'
    from /Users/swh/.rbenv/versions/2.3.3/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
    from /Users/swh/.rbenv/versions/2.3.3/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
    from /Users/swh/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:292:in `block in require'
    from /Users/swh/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:258:in `load_dependency'
    from /Users/swh/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:292:in `require'
    from /Users/swh/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/props-activerecord-0.1.0/lib/props/activerecord.rb:14:in `<top (required)>'
    from /Users/swh/.rbenv/versions/2.3.3/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
    from /Users/swh/.rbenv/versions/2.3.3/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
    from /Users/swh/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:292:in `block in require'
    from /Users/swh/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:258:in `load_dependency'
    from /Users/swh/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:292:in `require'
    from /Users/swh/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/worlddb-models-2.3.4/lib/worlddb/models.rb:30:in `<top (required)>'
    from /Users/swh/.rbenv/versions/2.3.3/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
    from /Users/swh/.rbenv/versions/2.3.3/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
    from /Users/swh/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/sportdb-models-1.16.2/lib/sportdb/models.rb:8:in `<top (required)>'
    from /Users/swh/.rbenv/versions/2.3.3/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
    from /Users/swh/.rbenv/versions/2.3.3/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
    from /Users/swh/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/sportdb-1.11.0/lib/sportdb.rb:4:in `<top (required)>'
    from /Users/swh/.rbenv/versions/2.3.3/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:in `require'
    from /Users/swh/.rbenv/versions/2.3.3/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:in `rescue in require'
    from /Users/swh/.rbenv/versions/2.3.3/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:40:in `require'
    from /Users/swh/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/sportdb-1.11.0/bin/sportdb:3:in `<top (required)>'
    from /Users/swh/.rbenv/versions/2.3.3/bin/sportdb:22:in `load'
    from /Users/swh/.rbenv/versions/2.3.3/bin/sportdb:22:in `<main>'

It looks like it has an issue with the class inherting from ActiveRecord::Migration directly on this line in props-activerecord, but I have no idea what the best way to deal with it is since it looks like a pretty deeply-nested dep.

geraldb commented 7 years ago

Thanks for trying sportdb and reporting the error. It's a known issue (with known workarounds). Please post to the forum / mailing list if you want answers / help etc. (from the community / others) Cheers. PS: Why the forum? Otherwise the issues get split over too many repos (20+). Thanks for your understanding.

scottwhudson commented 7 years ago

No worries! I should've checked 👍

geraldb commented 6 years ago

Sorry for the wait. I finally updated all gems to work with the latest (and greatest) version of ActiveRecord, that is, 5+. If you're still interested, please retry (spordb-models v1.17+ required). Cheers.