Getting: "Migrations are pending; run 'bin/rake db:migrate RAILS_ENV=development' to resolve this issue." after cloning and migrating the project

Stefanos.Ioannou picture Stefanos.Ioannou · Jan 23, 2014 · Viewed 90.4k times · Source

I cloned my project. Bundled with "bundle install", then run "rake db:migrate". I am getting this error: (when I run the rails server and open my browser to localhost:3000) "Migrations are pending; run 'bin/rake db:migrate RAILS_ENV=development' to resolve this issue."

I checked all migrations one by one and all were executed without errors. Also no errors were shown after the execution of "rake db:migrate".

This is what I see when I execute "rake db:migrate:status"

I am on development environment. Please let me know if you need any other information.

I also tried "bundle exec rake db:migrate", and "bundle exec rake db:migrate:reset" as "burninggramma" suggested.

Any clues what causes the error?

Answer

lewstherin picture lewstherin · Jan 23, 2014

Interesting. Did you run rake db:create? Assuming you are using sqlite3, do this:

      rm -f db/*.sqlite3
      rake db:create
      RAILS_ENV=development rake db:migrate
      rails s -e development

Also, can you list the contents of your config/database.yml file?

Edit: Warning! Obviously, you will lose your existing data.