I’ve been creating an app using Ruby on Rails on Windows for almost two years and I’ve had it. This weekend I started migrating my dev environment over to Ubuntu because it can run some tools/services not available in Windows.
I tried to run a migration and I got this error msg:
$ bundle exec rake db:migrate 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 AddAttachmentImportCsvFileToTabClientProjectCommunities < ActiveRecord::Migration[4.2] /home/joe/.rvm/gems/ruby-2.3.3/gems/activerecord-5.1.6/lib/active_record/migration.rb:525:in `inherited' /home/joe/workspace/asb_base/db/migrate/20170829235908_add_attachment_import_csv_file_to_tab_client_project_communities.rb:1:in `<top (required)>'
I thought maybe it was because the version of RoR I had on Ubuntu (Ruby 2.5.1/Rails 5.2.0) was different than that on Windows (v2.3.3/v5.1.4). I explicitly locked my RoR versions to use what I had in Windows and then ran the migration - still the same error msg. Has anyone else encountered this before?