I just finished my first Ruby on Rails app, and I'm trying to deploy it to Heroku. I am now at the final step, but when I run the following command (heroku run rake db:migrate), I am getting this error :
StandardError : Directly inheriting from ActiveRecord::Migration is not supported.
Please specify the Rails release the migration was written for.
Everyone on the web is saying that you just have to change
class CreateRelationships < ActiveRecord::Migration
to
class CreateRelationships < ActiveRecord::Migration[4.2]
The problem is that this solution doesn't work for me. Thank you in advance!
Add [5.1] if your ruby rails version is [5.1.5] even...just 5.1 class CreateRelationships < ActiveRecord::Migration[5.1]
like in this thread. Check in gemfile at the very top to see what version of rails you have.
I ran bundle install straight afters and and I ran the command that originally showed this error and it worked then worked. Not sure you need to run bundle install though..
Hope this helps Sput
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With