Rake can't connect for some reason

Hello. I have a problem with rails, i have been coding ruby for a couple
of weeks and i love it. So now i want to try Rails, and i am following a
tutorial. Right now i have created a database, set up all the stuff ruby
need (created a new project etc). Every step so far have been working
perfect, but now i am currently at the stage where i am going to use
“rake” to migrate databases/tables.

===============================================

development:
adapter: mysql
database: library_development
username: root
password: random
host: localhost

test:
adapter: mysql
database: library_test
username: root
password: random
host: localhost

production:
adapter: mysql
database: library_production
username: root
password: random
host: localhost

=======================================

Ok, so the database.yml seems nice, the password is working when i
connect thru mysql in the prompt.
But when i use “rake migrate:db” i get this error.

==============================================================
C:\ruby\library>rake db:migrate --trace
(in C:/ruby/library)
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:migrate
rake aborted!
Mysql::Error: query: not connected: CREATE TABLE schema_migrations
(version
varchar(255) NOT NULL) ENGINE=InnoDB
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_a
dapters/abstract_adapter.rb:219:in log' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_a dapters/mysql_adapter.rb:319:inexecute’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_a
dapters/abstract/schema_statements.rb:114:in create_table' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_a dapters/mysql_adapter.rb:472:increate_table’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_a
dapters/abstract/schema_statements.rb:320:in
initialize_schema_migrations_table ' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/migration.rb :436:ininitialize’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/migration.rb
:400:in new' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/migration.rb :400:inup’
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/migration.rb
:383:in migrate' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/tasks/databases.rake:116 c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:incall’
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in execute' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:ineach’
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in execute' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:ininvoke_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.7/lib/rake.rb:590:ininvoke_with_call_c
hain’
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in invoke' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:ininvoke_task’
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in
top_level' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:ineach’
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in
top_level' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:instandard_exceptio
n_handling’
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in
top_level' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:inrun’
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in
standard_exceptio n_handling' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:inrun’
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31
c:/ruby/bin/rake:19:in `load’
c:/ruby/bin/rake:19

C:\ruby\library>

So, the main error is “Mysql::Error: query: not connected: CREATE TABLE
schema_migrations (version
varchar(255) NOT NULL) ENGINE=InnoDB”.
I have googled for hours, tried 12 different religions, sacrificed a
virgin to the honor for ruby and caught an angel. But nothings works.
What to do?
Please help
/Alexander

Hi Alexander L.

  Have you read this?

http://halyph.blogspot.com/2009/08/rails-23-migration-issues-with-mysql_26.html

Sijo

Sijo k g wrote:

Hi Alexander L.

  Have you read this?

http://halyph.blogspot.com/2009/08/rails-23-migration-issues-with-mysql_26.html

Sijo

Woho! Thanks alot, it helped. I love you!