0

I have tried to run as a server before and it worked well, I don't change anything in the database but when I tried to run again a have this message Migrations are pending. To resolve this issue, run: bin/rake db:migrate RAILS_ENV=development

i tried as this site link but it failed any help please i am a beginner in ruby on rails

Community
  • 1
  • 1
miro
  • 79
  • 3
  • 9

2 Answers2

1

Migration files live in the db/migrate directory, and their names look like this:

20150121164407_create_comments.rb

From your comment, it looks like inside your db/migrate directory, you have several migrations with the same “basic” name create_comments (and probably different timestamps). You need to remove one of those duplicated files.

Bastien Léonard
  • 60,478
  • 20
  • 78
  • 95
0

If you did and if you don't have any important data in the database, you should destroy your database and recreate it using existing migrations. These commands in this order:
$ rake db:drop
if you're using postgres
$ rake db:create
and finally remigrate
$ rake db:migrate