16 Jan 2009, 19:25
Generic-user-small

Pravin Phansekar (1 post)

Hi,

I’m a newbie to ruby and rails.I’m encountering the following error while trying to add a column to an existing table using rake db:migrate command.

I am following instructions step by step – on page 73

C:\Depot>rake db:migrate (in C:/Depot) rake aborted! Mysql::Error: Commands out of sync; you can’t run this command now: SHOW TABLES

(See full trace by running task with –trace)

C:\Depot>rake db:migrate –trace (in C:/Depot) ** 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.2.2/lib/active_record/connection_a dapters/abstract_adapter.rb:188:in log' C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_a dapters/mysql_adapter.rb:309:in execute’ C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_a dapters/mysql_adapter.rb:414:in tables' C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/schema_dumpe r.rb:61:in tables’ C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/schema_dumpe r.rb:23:in dump' C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/schema_dumpe r.rb:17:in dump’ C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/tasks/databases.rake:246 C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/tasks/databases.rake:245:in open ' C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/tasks/databases.rake:245 C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in call’ C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in execute' C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in each’ C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in execute' C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:578:in invoke_with_call_c hain’ C:/Ruby/lib/ruby/1.8/monitor.rb:242:in synchronize' C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:571:in invoke_with_call_c hain’ C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:564:in invoke' C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/tasks/databases.rake:112 C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in call’ C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in execute' C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in each’ C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in execute' C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:578:in invoke_with_call_c hain’ C:/Ruby/lib/ruby/1.8/monitor.rb:242:in synchronize' C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:571:in invoke_with_call_c hain’ C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:564:in invoke' C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2019:in invoke_task’ C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in top_level' C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in each’ C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in top_level' C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2036:in standard_exceptio n_handling’ C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1991:in top_level' C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1970:in run’ C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2036:in standard_exceptio n_handling' C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1967:in run’ C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/bin/rake:31 C:/Ruby/bin/rake:19:in `load’ C:/Ruby/bin/rake:19

31 Jan 2009, 16:57
Generic-user-small

Daria (1 post)

I have the same problem and can’t figure out what’s wrong. Have you solve it? If so, could you please let me know?

Thanks!

06 Feb 2009, 14:58
Generic-user-small

Nick Lansdell (1 post)

I had the same problem as well. I searched for solutions but the only one I found was to go from mysql 5.1 to 5.0 which I did but, it did not work. In the end I did a complete uninstall of rails, all gems and ruby then re-installed the lot. I am relieved to say this has worked.

18 Mar 2009, 22:54
Generic-user-small

Kirk Hayes (4 posts)

I also have the same problem. I suspect the mysql_adapter.rb has a bug with the latest version of the mysql server 5.1.11.

I am going to try a 5.0 mysql and see what happens.

20 Feb 2010, 20:48
Generic-user-small

Carlos Wilfredo Mena Dahbura (2 posts)

Hi, everybody i have the same problem, when i make a rake db:migrate show me a windows message and im usign windows xp sp3, rubyinstaller-1.9.1-p243-rc1, mysql-essential-5.0.89-win32, really i dont know what is my problem and i have already the gem to mysql ive installed in this way: gem install mysql –no-ri –no-rdoc –plataform=mswin32 as you can see aparently i have everythin okm but i cannot make the rake command and where is my problem friends, help please!!

Bless!!

20 Feb 2010, 22:30
Generic-user-small

Carlos Wilfredo Mena Dahbura (2 posts)

Hi, my friends its me again xD i resolved the problem and everything is working out excellent, how i say i just have installed everything, but i wont made one thing. And its copy the “libmySQL.dll” from my mysql folder to ruby\bin and thats all you have to do whit the version 5.0 because with the version 5.1 give a lot a problem.

Hope everyone enjoy this help xD!!

Bless

  You must be logged in to comment