feedreader / pluto

pluto gems - planet feed reader and (static) website generator - auto-build web pages from published web feeds
Creative Commons Zero v1.0 Universal
192 stars 14 forks source link

Can't start pluto due to error with ActiveRecord::Migration #6

Closed liquidat closed 7 years ago

liquidat commented 7 years ago

I am trying to run pluto from within CentOS with ruby 2.3 installed. However, an error occurs stating that directly inheriting from ActiveRecord:Migration is not allowed:

$ pluto --help
activerecord-utils/0.4.0 (activerecord/5.1.4) on Ruby 2.3.1 (2016-04-26) [x86_64-linux]
/opt/app-root/src/.gem/ruby/gems/activerecord-5.1.4/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 ActivityDb::CreateDb < ActiveRecord::Migration[4.2]
    from /opt/app-root/src/.gem/ruby/gems/activityutils-0.1.0/lib/activityutils/schema.rb:3:in `<module:ActivityDb>'
    from /opt/app-root/src/.gem/ruby/gems/activityutils-0.1.0/lib/activityutils/schema.rb:1:in `<top (required)>'
    from /opt/rh/rh-ruby23/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /opt/rh/rh-ruby23/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /opt/app-root/src/.gem/ruby/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `block in require'
    from /opt/app-root/src/.gem/ruby/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:258:in `load_dependency'
    from /opt/app-root/src/.gem/ruby/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require'
    from /opt/app-root/src/.gem/ruby/gems/activityutils-0.1.0/lib/activityutils.rb:5:in `<top (required)>'
    from /opt/rh/rh-ruby23/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /opt/rh/rh-ruby23/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /opt/app-root/src/.gem/ruby/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `block in require'
    from /opt/app-root/src/.gem/ruby/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:258:in `load_dependency'
    from /opt/app-root/src/.gem/ruby/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require'
    from /opt/app-root/src/.gem/ruby/gems/pluto-models-1.4.0/lib/pluto/models.rb:29:in `<top (required)>'
    from /opt/rh/rh-ruby23/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /opt/rh/rh-ruby23/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /opt/app-root/src/.gem/ruby/gems/pluto-1.2.3/lib/pluto.rb:3:in `<top (required)>'
    from /opt/rh/rh-ruby23/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /opt/rh/rh-ruby23/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /opt/app-root/src/.gem/ruby/gems/pluto-1.2.3/bin/pluto:3:in `<top (required)>'
    from /opt/app-root/src/bin/pluto:23:in `load'
    from /opt/app-root/src/bin/pluto:23:in `<main>'

The version is 2.3, I installed the necessary gems by gem install pluto:

$ ruby --version
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]
bash-4.2$ gem list

*** LOCAL GEMS ***

activemodel (5.1.4)
activerecord (5.1.4)
activerecord-utils (0.4.0)
activesupport (5.1.4)
activityutils (0.1.0)
arel (8.0.0)
bigdecimal (1.2.8)
bundler (1.10.6)
concurrent-ruby (1.0.5)
did_you_mean (1.0.0)
feedfilter (1.1.1)
feedparser (2.1.0)
fetcher (0.4.5)
gli (2.16.1)
i18n (0.8.6)
iniparser (0.1.0)
io-console (0.4.5)
json (1.8.3)
liquid (4.0.0)
logutils (0.6.1)
logutils-activerecord (0.2.1)
minitest (5.10.3)
pakman (0.7.0)
pluto (1.2.3)
pluto-feedfetcher (0.1.0)
pluto-merge (1.1.0)
pluto-models (1.4.0)
pluto-tasks (1.5.3)
pluto-update (1.6.0)
preproc (0.1.0)
props (1.2.0)
props-activerecord (0.2.0)
psych (2.0.17)
rake (10.4.2)
rdoc (4.2.1)
rubyzip (1.2.1)
sqlite3 (1.3.13)
textutils (1.4.0)
thread_safe (0.3.6)
tzinfo (1.2.3)

I can recreate the issue every time. In fact, so far I was not able to get pluto running anywhere. The aim is to set up a container image for at least two planets I am responsible for.

ggambini commented 7 years ago

Hello

Same error here. First time i use a ruby program. Im on Centos7, i install ruby24 from SCL repository. gem install command complete without error, but pluto command return error :

> # pluto --version
> activerecord-utils/0.4.0 (activerecord/5.1.4) on Ruby 2.4.0 (2016-12-24) [x86_64-linux]
> /opt/rh/rh-ruby24/root/usr/local/share/gems/gems/activerecord-5.1.4/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 ActivityDb::CreateDb < ActiveRecord::Migration[4.2]
>         from /opt/rh/rh-ruby24/root/usr/local/share/gems/gems/activityutils-0.1.0/lib/activityutils/schema.rb:3:in `<module:ActivityDb>'
>         from /opt/rh/rh-ruby24/root/usr/local/share/gems/gems/activityutils-0.1.0/lib/activityutils/schema.rb:1:in `<top (required)>'
>         from /opt/rh/rh-ruby24/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
>         from /opt/rh/rh-ruby24/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
>         from /opt/rh/rh-ruby24/root/usr/local/share/gems/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `block in require'
>         from /opt/rh/rh-ruby24/root/usr/local/share/gems/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:258:in `load_dependency'
>         from /opt/rh/rh-ruby24/root/usr/local/share/gems/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require'
>         from /opt/rh/rh-ruby24/root/usr/local/share/gems/gems/activityutils-0.1.0/lib/activityutils.rb:5:in `<top (required)>'
>         from /opt/rh/rh-ruby24/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
>         from /opt/rh/rh-ruby24/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
>         from /opt/rh/rh-ruby24/root/usr/local/share/gems/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `block in require'
>         from /opt/rh/rh-ruby24/root/usr/local/share/gems/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:258:in `load_dependency'
>         from /opt/rh/rh-ruby24/root/usr/local/share/gems/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require'
>         from /opt/rh/rh-ruby24/root/usr/local/share/gems/gems/pluto-models-1.4.0/lib/pluto/models.rb:29:in `<top (required)>'
>         from /opt/rh/rh-ruby24/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
>         from /opt/rh/rh-ruby24/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
>         from /opt/rh/rh-ruby24/root/usr/local/share/gems/gems/pluto-1.2.3/lib/pluto.rb:3:in `<top (required)>'
>         from /opt/rh/rh-ruby24/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
>         from /opt/rh/rh-ruby24/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
>         from /opt/rh/rh-ruby24/root/usr/local/share/gems/gems/pluto-1.2.3/bin/pluto:3:in `<top (required)>'
>         from /opt/rh/rh-ruby24/root/usr/local/bin/pluto:22:in `load'
>         from /opt/rh/rh-ruby24/root/usr/local/bin/pluto:22:in `<main>'
> 

Packages installed : rh-ruby24-rubygems, rh-ruby24, rh-ruby24-rubydevel and sqlite-devel.

Regards, Gamb.

geraldb commented 7 years ago

@ggambini @liquidat Thanks for reporting (sorry I was on vacaction / offline last week). I've updated the pluto-models gem / library to support the latest (and greatest) version of ActiveRecord, that is, the 5.0 series. If you update the pluto-models gem (plus dependencies) it should now work (as advertised) with Ruby 2.3+ and ActiveRecord 5+ Happy planet. If you still run into problems / troubles, please report back. Thanks. Cheers.