Jump to content

The ultimate community for Ruby on Rails developers.


Rails 4 throws pending migrations error even if there are no pending migrations

ruby-on-rails-4 migrations

  • Please log in to reply
No replies to this topic

#1 aslam



  • Members
  • 1 posts

Posted 26 March 2014 - 06:01 AM

I recently upgraded my app from Rails 3.2.15 to Rails 4.0.4 and rake test fails throwing:
You have 161 pending migrations:
      20111126090934 DeviseCreateUsers
      20111126195631 AddUsernameToUsers
      20111128012039 CreateLocations
      20111129051416 AddConfirmableToDevise

Run `rake db:migrate` to update your database then try again.

I am sure, I don't have any pending migrations and the schema_migrations table is up-to date with all the migration version numbers. Also,

pry(main)> ActiveRecord::Migration.check_pending!
  ActiveRecord::SchemaMigration Load (0.4ms)  SELECT `schema_migrations`.* FROM `schema_migrations`
=> nil
 $> rake db:migrate:status   
Status   Migration ID    Migration Name
up     20111126090934  ********** NO FILE **********
up     20111126195631  ********** NO FILE **********
up     20111128012039  ********** NO FILE **********
up     20111129051416  ********** NO FILE **********

show that I don't have any pending migrations. 


Since, this is development environment I've also tried to reset db with:

 $> rake db:migrate:reset
I am in the process of moving my app from Rails 3.2.15 to Rails 4.0.4. I am at a loss here, not understanding what is happening. I've also tried SO, but with little luck.

Also tagged with one or more of these keywords: ruby-on-rails-4, migrations

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users