# Rake aborted! Mysql::Error

**URL:** <https://www.ruby-forum.com/t/rake-aborted-mysql-error/70146>\
**Category:** Rails\
**Created:** [September 27, 2006, 2:34am UTC](https://www.ruby-forum.com/t/rake-aborted-mysql-error/70146 "2006-09-27T02:34:57Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jacquie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/35a633/32.png) [@jacquie](https://www.ruby-forum.com/u/jacquie)\
**Post date:** [September 27, 2006, 2:34am UTC](https://www.ruby-forum.com/t/rake-aborted-mysql-error/70146/1 "2006-09-27T02:34:57Z")

</div>

Hi,I followed the process of creating depot in the book ‘Ruby on Rails’  
all works fine until I came to the ‘Checkout’ chapter.

After I created the two models order and line\_item and got the two  
migration file altered according to the book, I failed by running rake  
db:migrate

errors are shown as below

# C:\Java\workspace\depot\>rake db:migrate (in C:/Java/workspace/depot) == CreateLineItems: migrating

– create\_table(:line\_items)  
rake aborted!  
Mysql::Error: #42S01Table ‘line\_items’ already exists: CREATE TABLE  
line\_items (  
`id` int(11) DEFAULT NULL auto\_increment PRIMARY KEY, `product_id`  
int(11) NOT N  
ULL, `order_id` int(11) NOT NULL, `quantity` int(11) NOT NULL,  
`total_price` int  
(11) NOT NULL) ENGINE=InnoDB

By running --trace I can also see

C:\Java\workspace\depot\>rake db:migrate -trace  
C:/InstantRails/ruby/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:21:in  
`re quire__': no such file to load -- ace (LoadError) from C:/InstantRails/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require .rb:21:in`require’  
from  
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:  
1749:in `do_option' from C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb: 1787:in`handle\_options’  
from C:/InstantRails/ruby/lib/ruby/1.8/getoptlong.rb:460:in  
`each' from C:/InstantRails/ruby/lib/ruby/1.8/getoptlong.rb:457:in`each’  
from  
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:  
1787:in `handle_options' from C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb: 1897:in`run’  
from  
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/bin/rake:7  
from C:/InstantRails/ruby/bin/rake.bat:25

I followed the book strictly, so couldn;t figured out what has happened.

anybody has a similar/same problem using this book? greatly appreciated  
for your help!

---

<div class="post-metadata">

**Author:** ![jacquie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/35a633/32.png) [@jacquie](https://www.ruby-forum.com/u/jacquie)\
**Post date:** [September 27, 2006, 2:54am UTC](https://www.ruby-forum.com/t/rake-aborted-mysql-error/70146/2 "2006-09-27T02:54:22Z")

</div>

Is that table already in the system? If so, you may have to use the  
“force” option with create\_table. Did you happen to run rake migrate  
before you added the columns?

Jacquie F. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:  
Hi,I followed the process of creating depot in the book ‘Ruby on Rails’  
all works fine until I came to the ‘Checkout’ chapter.

After I created the two models order and line\_item and got the two  
migration file altered according to the book, I failed by running rake  
db:migrate

errors are shown as below

# C:\Java\workspace\depot\>rake db:migrate (in C:/Java/workspace/depot) == CreateLineItems: migrating

– create\_table(:line\_items)  
rake aborted!  
Mysql::Error: #42S01Table ‘line\_items’ already exists: CREATE TABLE  
line\_items (  
`id` int(11) DEFAULT NULL auto\_increment PRIMARY KEY, `product_id`  
int(11) NOT N  
ULL, `order_id` int(11) NOT NULL, `quantity` int(11) NOT NULL,  
`total_price` int  
(11) NOT NULL) ENGINE=InnoDB

By running --trace I can also see

C:\Java\workspace\depot\>rake db:migrate -trace  
C:/InstantRails/ruby/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:21:in  
`re quire__': no such file to load -- ace (LoadError) from C:/InstantRails/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require .rb:21:in `require’  
from  
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:  
1749:in `do_option' from C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb: 1787:in `handle\_options’  
from C:/InstantRails/ruby/lib/ruby/1.8/getoptlong.rb:460:in  
`each' from C:/InstantRails/ruby/lib/ruby/1.8/getoptlong.rb:457:in `each’  
from  
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:  
1787:in `handle_options' from C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb: 1897:in `run’  
from  
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rake-0.7.1/bin/rake:7  
from C:/InstantRails/ruby/bin/rake.bat:25

I followed the book strictly, so couldn;t figured out what has happened.

anybody has a similar/same problem using this book? greatly appreciated  
for your help!

–  
Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

* * *

Get your email and more, right on the new [Yahoo.com](http://Yahoo.com)

---

<div class="post-metadata">

**Author:** ![jacquie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/35a633/32.png) [@jacquie](https://www.ruby-forum.com/u/jacquie)\
**Post date:** [September 27, 2006, 3:12am UTC](https://www.ruby-forum.com/t/rake-aborted-mysql-error/70146/3 "2006-09-27T03:12:45Z")

</div>

Thanks for the help! The migration works now by adding :force=\>true

Will G. wrote:

> Is that table already in the system? If so, you may have to use the  
> “force” option with create\_table. Did you happen to run rake migrate  
> before you added the columns?
> 
> Jacquie F. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:  
> Hi,I followed the process of creating depot in the book ‘Ruby on Rails’  
> all works fine until I came to the ‘Checkout’ chapter.
> 
> After I created the two models order and line\_item and got the two  
> migration file altered according to the book, I failed by running rake  
> db:migrate

---

<div class="post-metadata">

**Author:** ![jacquie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/35a633/32.png) [@jacquie](https://www.ruby-forum.com/u/jacquie)\
**Post date:** [September 27, 2006, 3:24am UTC](https://www.ruby-forum.com/t/rake-aborted-mysql-error/70146/4 "2006-09-27T03:24:25Z")

</div>

Right, but bear in mind the force=\>true overwrites your data. Please  
tell me you didn’t learn it the hard way like I did…

Jacquie F. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:  
Thanks for the help! The migration works now by adding :force=\>true

Will G. wrote:

> db:migrate  
> –  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

* * *

Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls. Great  
rates starting at 1Â¢/min.

---

<div class="post-metadata">

**Author:** ![jacquie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/35a633/32.png) [@jacquie](https://www.ruby-forum.com/u/jacquie)\
**Post date:** [September 27, 2006, 4:00am UTC](https://www.ruby-forum.com/t/rake-aborted-mysql-error/70146/5 "2006-09-27T04:00:27Z")

</div>

Ugh. The way I said that sounds kind of bad. I just hope I didn’t cause  
you to have to re-enter a whole mess of data (like I’ve done a couple of  
times)…

Will G. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote: Right, but bear in mind the  
force=\>true overwrites your data. Please tell me you didn’t learn it the  
hard way like I did…

Jacquie F. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:  
Thanks for the help! The migration works now by adding :force=\>true

Will G. wrote:

> db:migrate  
> –  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

* * *

Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls. Great  
rates starting at 1Â¢/min.

* * *

All-new Yahoo! Mail - Fire up a more powerful email and get things done  
faster.

---

<div class="post-metadata">

**Author:** ![jacquie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/35a633/32.png) [@jacquie](https://www.ruby-forum.com/u/jacquie)\
**Post date:** [October 18, 2006, 6:53pm UTC](https://www.ruby-forum.com/t/rake-aborted-mysql-error/70146/6 "2006-10-18T18:53:52Z")

</div>

I’m having a similar problem here… I’m not able to get rid of force  
=\> true flag. On every migration or “rake db:fixtures:load” I run, the  
db/schema.db file is updated with force=\>true.

What am I missing ? Is there any config/environment.rb setting I’ve to  
add/modify to get rid of force=\>true ?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![jacquie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/35a633/32.png) [@jacquie](https://www.ruby-forum.com/u/jacquie)\
**Post date:** [October 9, 2006, 7:59am UTC](https://www.ruby-forum.com/t/rake-aborted-mysql-error/70146/7 "2006-10-09T07:59:25Z")

</div>

Thanks for reminding me. No I didn’t enter anything yet.=)

Will G. wrote:

> Ugh. The way I said that sounds kind of bad. I just hope I didn’t cause  
> you to have to re-enter a whole mess of data (like I’ve done a couple of  
> times)…
> 
> Will G. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote: Right, but bear in mind the  
> force=\>true overwrites your data. Please tell me you didn’t learn it the  
> hard way like I did…
> 
> * * *
> 
> All-new Yahoo! Mail - Fire up a more powerful email and get things done  
> faster.
