05 Jul 2013, 10:23
Me_bw_pragsmall

Adrian Enns (1 post)

Hi

First of all, this book is really awesome.

I got a problem on the downmethod ( source:https://github.com/addisaden/learning-rails/commit/33eea1ffad963cdcbc4443266d3bfd5ae9940dfa ) on page 122.

When i try to Rollback, it rolls back but the rails app doesnt work any more. it shows ActiveRecord::PendingMigrationError. After rake db:migrate it runs again.

I also researched the cart after the Rollback via rails console and the items showed up with a quantity of 1. So for me its not possible to solve this, because i am new in rails :)

Thanks a lot Adrian

edit: after cloning the project from github on a clean directory i migrate all, add a ruby book, rollback and get the same issue.

08 Jul 2013, 04:29
Generic-user-small

Andy Cox (1 post)

In your @config/environments/development.rb@ file, look for the @config.active_record.migration_error@ line and either remove the line or change the value to @:app_start@, and restart your rails server.

08 Jul 2013, 04:58
Generic-user-small

Malcolm McKeown (2 posts)

I think the book expects you to temporarily move the migration file out of the migrations directory, although the instruction was a bit vague:

“We can inspect the results of the rollback by moving the migration to another directory and looking at the cart:”

If you don’t do this then you will get the error that you describe (assuming the configuration option that Andy mentioned hasn’t been changed).

  You must be logged in to comment