#171 √ resolved
David Chelimsky

db:abort_if_pending_migrations breaks rspec's pre_commit task

Reported by David Chelimsky | December 7th, 2007 @ 03:52 PM | in 1.1.0

This changeset: http://dev.rubyonrails.org/chang... causes rspec's pre_commit task to fail:

Run `rake db:migrate` to update your database then try again.
(in /Users/david/projects/ruby/rspec/example_rails_app)
running against rails edge
** Invoke spec:plugins:rspec_on_rails (first_time)
** Invoke db:test:prepare (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke db:abort_if_pending_migrations (first_time)
** Invoke environment 
** Execute db:abort_if_pending_migrations
You have 5 pending migrations:
     1 InitialSchema
     2 CreateAnimals
     3 CreateThings
     4 CreateMockables
     5 CreatePurchases
rake aborted!
ERROR while running rake: rake spec:plugins:rspec_on_rails  --trace

(See full trace by running task with --trace)

Comments and changes to this ticket

  • David Chelimsky

    David Chelimsky December 7th, 2007 @ 03:53 PM

    • → State changed from “new” to “open”

    Unfortunately, they added this just before the 2.0.0 release, which means we HAVE to resolve this for anyone to use rspec's trunk.

  • Chad Humphries

    Chad Humphries December 7th, 2007 @ 04:57 PM

    This fixes the issue generated by the changed spec, however it seems several routing specs are failing. I'm not sure if this fix is the best approach, just the first I encountered that leaves all other versions working without issue, and fixes the issue at hand in edge.

    I'm going to look at the routing specs after lunch.

  • Bryan Helmkamp

    Bryan Helmkamp December 7th, 2007 @ 05:05 PM

    From my understanding, the abort happens if and only if there are migrations in db/migrate that haven't been run. I'm thinking for a patch we could move migrations into and out of db/migrate as we need them, so that the schema version number in the DB always matches the highest in db/migrate.

    I'll take a crack at a patch for this tonight if it's still an issue.

  • David Chelimsky

    David Chelimsky December 7th, 2007 @ 08:34 PM

    • → State changed from “open” to “resolved”

    This is fixed now as of r3070. Thanks to Chad Humphries for the quick patch.

Please Login or create a free account to add a new comment.

You can update this ticket by sending an email to from your email client. (help)

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Behaviour Driven Development for Ruby.

Shared Ticket Bins

People watching this ticket