# Rake db:migrate error - Agile Web Dev with Rails P1.0

**URL:** <https://www.ruby-forum.com/t/rake-db-migrate-error-agile-web-dev-with-rails-p1-0/179226>\
**Category:** Rails\
**Created:** [November 20, 2009, 2:30am UTC](https://www.ruby-forum.com/t/rake-db-migrate-error-agile-web-dev-with-rails-p1-0/179226 "2009-11-20T02:30:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![alphacoder](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/5f8ce5/32.png) [@alphacoder](https://www.ruby-forum.com/u/alphacoder)\
**Post date:** [November 20, 2009, 2:30am UTC](https://www.ruby-forum.com/t/rake-db-migrate-error-agile-web-dev-with-rails-p1-0/179226/1 "2009-11-20T02:30:35Z")

</div>

Hi,  
Getting this error and hope someone can point me in the direction to  
solve it:

# == AddPriceToProduct: migrating

– add\_column(:products, :price, :decimal, {:precision=\>8, :scale=\>2,  
:default=\>0})  
rake aborted!  
An error has occurred, this and all later migrations canceled:

SQLite3::SQLException: no such table: products: ALTER TABLE “products”  
ADD “price” decimal(8,2) DEFAULT 0

I’m using the Agile Web D. with Rails P1.0 book and after I  
input this:

ruby script/generate migration add\_price\_to\_product price:decimal

all seemed ok. I then modified the xxx\_add\_price\_to\_product.rb file as  
specified in the book and when I tried the rake db:migrate, it throws  
that exception.

The problem is, I used the SQLite Browser on my Ubuntu 9.10 box and it  
shows the table exists in the development.sqlite3 database. I’m  
stumped…

Thanks in advance for any help,  
SS

---

<div class="post-metadata">

**Author:** ![alphacoder](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/5f8ce5/32.png) [@alphacoder](https://www.ruby-forum.com/u/alphacoder)\
**Post date:** [November 20, 2009, 4:26am UTC](https://www.ruby-forum.com/t/rake-db-migrate-error-agile-web-dev-with-rails-p1-0/179226/2 "2009-11-20T04:26:51Z")

</div>

Hi all,  
Not sure what really did it but solved it, here it is for future  
reference. Since I’ve been using a few different machines over the past  
hour, not sure where I got the different steps from, if anyone knows,  
please post credit.

1. Installed sqlite3-ruby gem using sudo gem install sqlite3-ruby. Not  
sure how/why this did anything since the table was created on the  
set/generate earlier.

2. Stopped Webrick and restarted.

That’s all, really uncertain why this worked…and yes, I do believe in  
magic! 🙂

Sheridan Sheridan wrote:

> Hi,  
> Getting this error and hope someone can point me in the direction to  
> solve it:
> 
> # == AddPriceToProduct: migrating
> 
> – add\_column(:products, :price, :decimal, {:precision=\>8, :scale=\>2,  
> :default=\>0})  
> rake aborted!  
> An error has occurred, this and all later migrations canceled:
> 
> SQLite3::SQLException: no such table: products: ALTER TABLE “products”  
> ADD “price” decimal(8,2) DEFAULT 0
> 
> I’m using the Agile Web D. with Rails P1.0 book and after I  
> input this:
> 
> ruby script/generate migration add\_price\_to\_product price:decimal
> 
> all seemed ok. I then modified the xxx\_add\_price\_to\_product.rb file as  
> specified in the book and when I tried the rake db:migrate, it throws  
> that exception.
> 
> The problem is, I used the SQLite Browser on my Ubuntu 9.10 box and it  
> shows the table exists in the development.sqlite3 database. I’m  
> stumped…
> 
> Thanks in advance for any help,  
> SS
