Reputation: 41
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?
Upvotes: 2
Views: 7266
Reputation: 622
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/
Upvotes: 7
Reputation: 3052
$ rm db/schema.rb
$ bundle exec rake db:drop
$ bundle exec rake db:create
$ bundle exec rake db:migrate
Upvotes: 1