All good during installation until I arrive to the following step from the README.
$ rails g ckeditor:install --orm=active_record --backend=paperclip && rake db:migrate
This command fails returning the following content:
$ rails g ckeditor:install --orm=active_record --backend=paperclip && rake db:migrate
Running via Spring preloader in process 55518
create config/initializers/ckeditor.rb
route mount Ckeditor::Engine => '/ckeditor'
create app/models/ckeditor/asset.rb
create app/models/ckeditor/picture.rb
create app/models/ckeditor/attachment_file.rb
create db/migrate/20171024133830_create_ckeditor_assets.rb
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:
Directly inheriting from ActiveRecord::Migration is not supported. Please specify the Rails release the migration was written for:
class CreateCkeditorAssets < ActiveRecord::Migration[4.2]
/Users/kinduff/.rvm/gems/ruby-2.4.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:525:in `inherited'
/Users/kinduff/www/biutiko-store-new/db/migrate/20171024133830_create_ckeditor_assets.rb:1:in `<top (required)>'
/Users/kinduff/.rvm/gems/ruby-2.4.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
/Users/kinduff/.rvm/gems/ruby-2.4.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
/Users/kinduff/.rvm/gems/ruby-2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `block in require'
/Users/kinduff/.rvm/gems/ruby-2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:258:in `load_dependency'
/Users/kinduff/.rvm/gems/ruby-2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require'
/Users/kinduff/.rvm/gems/ruby-2.4.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:962:in `load_migration'
/Users/kinduff/.rvm/gems/ruby-2.4.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:958:in `migration'
/Users/kinduff/.rvm/gems/ruby-2.4.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:953:in `disable_ddl_transaction'
/Users/kinduff/.rvm/gems/ruby-2.4.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:1305:in `use_transaction?'
/Users/kinduff/.rvm/gems/ruby-2.4.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:1297:in `ddl_transaction'
/Users/kinduff/.rvm/gems/ruby-2.4.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:1229:in `execute_migration_in_transaction'
/Users/kinduff/.rvm/gems/ruby-2.4.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:1201:in `block in migrate_without_lock'
/Users/kinduff/.rvm/gems/ruby-2.4.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:1200:in `each'
/Users/kinduff/.rvm/gems/ruby-2.4.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:1200:in `migrate_without_lock'
/Users/kinduff/.rvm/gems/ruby-2.4.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:1148:in `block in migrate'
/Users/kinduff/.rvm/gems/ruby-2.4.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:1317:in `with_advisory_lock'
/Users/kinduff/.rvm/gems/ruby-2.4.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:1148:in `migrate'
/Users/kinduff/.rvm/gems/ruby-2.4.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:1007:in `up'
/Users/kinduff/.rvm/gems/ruby-2.4.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:985:in `migrate'
/Users/kinduff/.rvm/gems/ruby-2.4.0/gems/activerecord-5.1.4/lib/active_record/tasks/database_tasks.rb:171:in `migrate'
/Users/kinduff/.rvm/gems/ruby-2.4.0/gems/activerecord-5.1.4/lib/active_record/railties/databases.rake:58:in `block (2 levels) in <top (required)>'
/Users/kinduff/.rvm/gems/ruby-2.4.0/gems/rake-12.1.0/exe/rake:27:in `<top (required)>'
/Users/kinduff/.rvm/gems/ruby-2.4.0/bin/ruby_executable_hooks:15:in `eval'
/Users/kinduff/.rvm/gems/ruby-2.4.0/bin/ruby_executable_hooks:15:in `<main>'
StandardError: Directly inheriting from ActiveRecord::Migration is not supported. Please specify the Rails release the migration was written for:
class CreateCkeditorAssets < ActiveRecord::Migration[4.2]
/Users/kinduff/.rvm/gems/ruby-2.4.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:525:in `inherited'
/Users/kinduff/www/biutiko-store-new/db/migrate/20171024133830_create_ckeditor_assets.rb:1:in `<top (required)>'
/Users/kinduff/.rvm/gems/ruby-2.4.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
/Users/kinduff/.rvm/gems/ruby-2.4.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
/Users/kinduff/.rvm/gems/ruby-2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `block in require'
/Users/kinduff/.rvm/gems/ruby-2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:258:in `load_dependency'
/Users/kinduff/.rvm/gems/ruby-2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require'
/Users/kinduff/.rvm/gems/ruby-2.4.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:962:in `load_migration'
/Users/kinduff/.rvm/gems/ruby-2.4.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:958:in `migration'
/Users/kinduff/.rvm/gems/ruby-2.4.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:953:in `disable_ddl_transaction'
/Users/kinduff/.rvm/gems/ruby-2.4.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:1305:in `use_transaction?'
/Users/kinduff/.rvm/gems/ruby-2.4.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:1297:in `ddl_transaction'
/Users/kinduff/.rvm/gems/ruby-2.4.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:1229:in `execute_migration_in_transaction'
/Users/kinduff/.rvm/gems/ruby-2.4.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:1201:in `block in migrate_without_lock'
/Users/kinduff/.rvm/gems/ruby-2.4.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:1200:in `each'
/Users/kinduff/.rvm/gems/ruby-2.4.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:1200:in `migrate_without_lock'
/Users/kinduff/.rvm/gems/ruby-2.4.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:1148:in `block in migrate'
/Users/kinduff/.rvm/gems/ruby-2.4.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:1317:in `with_advisory_lock'
/Users/kinduff/.rvm/gems/ruby-2.4.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:1148:in `migrate'
/Users/kinduff/.rvm/gems/ruby-2.4.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:1007:in `up'
/Users/kinduff/.rvm/gems/ruby-2.4.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:985:in `migrate'
/Users/kinduff/.rvm/gems/ruby-2.4.0/gems/activerecord-5.1.4/lib/active_record/tasks/database_tasks.rb:171:in `migrate'
/Users/kinduff/.rvm/gems/ruby-2.4.0/gems/activerecord-5.1.4/lib/active_record/railties/databases.rake:58:in `block (2 levels) in <top (required)>'
/Users/kinduff/.rvm/gems/ruby-2.4.0/gems/rake-12.1.0/exe/rake:27:in `<top (required)>'
/Users/kinduff/.rvm/gems/ruby-2.4.0/bin/ruby_executable_hooks:15:in `eval'
/Users/kinduff/.rvm/gems/ruby-2.4.0/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
I find this error kind of weird because I've been installing other gems with migrations with the same pattern and I've not encounter any issue during install.
Any workarounds or guidance about how to install successfully?
Update
I was able to work around it by adding manually [4.2] to the CKEditor migration that was added to my project at db/migrate/20171024133830_create_ckeditor_assets.rb.
Hello, I'm adding this gem to a Spree 3-4-stable installation.
And in my Gemfile:
All good during installation until I arrive to the following step from the README.
This command fails returning the following content:
I find this error kind of weird because I've been installing other gems with migrations with the same pattern and I've not encounter any issue during install.
Any workarounds or guidance about how to install successfully?