Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ruby on Rails error ActiveRecord::PendingMigrationError

this is what I get when I run the project Hi, I'm working on a project. When I run my project, I got this problem: Migrations are pending. To resolve this issue, run:

bin/rake db:migrate RAILS_ENV=development
 raise ActiveRecord::PendingMigrationError if ActiveRecord::Migrator.needs_migration?

(connection)

I've already tried several solutions below:

1)

rake db:drop
rake db:create
rake db:migrate

2) bundle exec rake db:migrate

3) bin/rake db:migrate RAILS_ENV=development

but they didn't work, and I got the same error over and over again. What can I do?

like image 776
Hara Jang Avatar asked Aug 04 '26 10:08

Hara Jang


1 Answers

Your first try was close, you need to do

rake db:drop
rake db:create
rake db:schema:load

Check this article it may be helpful. http://icebergist.com/posts/rake-db-migrate-vs-rake-db-schema-load/

like image 174
Jovica Šuša Avatar answered Aug 06 '26 01:08

Jovica Šuša



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!