# Problems with Ruby code, when creating a mysql db

**URL:** <https://www.ruby-forum.com/t/problems-with-ruby-code-when-creating-a-mysql-db/164093>\
**Category:** Rails\
**Created:** [March 27, 2009, 8:10pm UTC](https://www.ruby-forum.com/t/problems-with-ruby-code-when-creating-a-mysql-db/164093 "2009-03-27T20:10:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jameslabocki](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ad7895/32.png) [@jameslabocki](https://www.ruby-forum.com/u/jameslabocki)\
**Post date:** [March 27, 2009, 8:10pm UTC](https://www.ruby-forum.com/t/problems-with-ruby-code-when-creating-a-mysql-db/164093/1 "2009-03-27T20:10:11Z")

</div>

When I run rake db:migrate --trace I get the following

(in C:/myRailsWork/bingo)  
\*\* Invoke db:migrate (first\_time)  
\*\* Invoke environment (first\_time)  
\*\* Execute environment  
\*\* Execute db:migrate  
\*\* Invoke db:schema:dump (first\_time)  
\*\* Invoke environment  
\*\* Execute db:schema:dump  
rake aborted!  
Mysql::Error: Commands out of sync; you can’t run this command now: SHOW  
TABLES  
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active\_record/connection\_adapters/abstract\_adapter.rb:212:in  
`log' C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/mysql_adapter.rb:320:in`execute’  
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active\_record/connection\_adapters/mysql\_adapter.rb:436:in  
`tables' C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/schema_dumper.rb:63:in`tables’

While walking through the mysql\_adapter.rb I found it suggests running

rake db:schema:load --trace generates the following error were rake  
thinks the  
commented end is part of the code run

(in C:/myRailsWork/bingo)  
\*\* Invoke db:schema:load (first\_time)  
\*\* Invoke environment (first\_time)  
\*\* Execute environment  
\*\* Execute db:schema:load  
rake aborted!  
C:/myRailsWork/bingo/db/schema.rb:13: syntax error, unexpected $end  
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active\_support/dependencies.rb:145:in  
`load_without_new_constant_marking' C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:145:in`load’  
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active\_support/dependencies.rb:521:in  
`new_constants_in' C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:145:in`load’
