0

StandardError Directly inheriting from ActiveRecord::Migration is not supported. Please specify the Active Record release the migration was written for: class AddAttachmentImageToPosts < ActiveRecord::Migration[7.0] Extracted source (around line #596):

    major = ActiveRecord::VERSION::MAJOR
    minor = ActiveRecord::VERSION::MINOR
    raise StandardError, "Directly inheriting from ActiveRecord::Migration is not supported. " \
      "Please specify the Active Record release the migration was written for:\n" \
      "\n" \
      "  class #{subclass} < ActiveRecord::Migration[#{major}.#{minor}]"

Directly inheriting from ActiveRecord::Migration is not supported. Please specify the Active Record release the migration was written for: class AddAttachmentImageToPosts < ActiveRecord::Migration[7.0] Extracted source (around line #596):

2
  • 2
    Are you setting up local environment for an old rails app? run rake db:setup or rake db:schema:loadinstead of running all the old migrations.
    – BroiSatse
    Commented Feb 2 at 1:55
  • This error is shown, when you try running old migrations that were created with old version of Ruby on Rails with up-to-date versions. Follow the advice @BroiSatse gave, or you need to fix all old migrations to follow the conventions for current versions of Ruby on Rails. Commented Feb 2 at 9:30

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.