-1

I'm getting a so called 'StandardError' when I run rake db:migrate. I ran this command:

rake db:migrate 

And got this 'StandardError' in a Mac Terminal

Screenshot of error in Mac Terminal

halfer
  • 19,824
  • 17
  • 99
  • 186
  • are you trying to run migrations for a rails app you've cloned from somewhere? or is this a new app you're working on? – eiko Jun 19 '17 at 16:28
  • @eiko This is an app I'm working ins – Frederick Nielsen Jun 19 '17 at 17:06
  • 2
    Why try to include a screen shot of text when the text itself would be easier to post and easier for us to read? – mu is too short Jun 19 '17 at 17:15
  • @muistooshort I was having trouble with making it readable when I posted it directly as code. I don't see it as a big problem though. Hope it's all good. All I want is a comment on how to fix this. – Frederick Nielsen Jun 19 '17 at 17:17
  • Yes please, we prefer text. Images are not compatible with clipboards, screen-readers and search engines, and thus make it harder to satisfy our goal of helping as many people as possible. Use the code formatting tool to present console I/O. – halfer Jun 19 '17 at 18:38
  • @halfer I will change this in my future posts. Thanks. – Frederick Nielsen Jun 19 '17 at 18:49

1 Answers1

0

Go through all your migration files in db/migrate and change this line:

class XYZ < ActiveRecord::Migration

to look like this instead:

class XYZ < ActiveRecord::Migration[5.0]

I'm assuming you're working with an old / poorly maintained app. If you're generating migrations yourself and they're not automatically including [5.0] at the end, then you should probably open a second question to figure that part out.

eiko
  • 5,110
  • 6
  • 17
  • 35