# Rails xxx database=mysql produces invalid database.yml under Windows

**URL:** <https://www.ruby-forum.com/t/rails-xxx-database-mysql-produces-invalid-database-yml-under-windows/140010>\
**Category:** Rails\
**Created:** [June 10, 2008, 2:29am UTC](https://www.ruby-forum.com/t/rails-xxx-database-mysql-produces-invalid-database-yml-under-windows/140010 "2008-06-10T02:29:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![RichardOnRails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e0b2c6/32.png) [@RichardOnRails](https://www.ruby-forum.com/u/RichardOnRails)\
**Post date:** [June 10, 2008, 2:29am UTC](https://www.ruby-forum.com/t/rails-xxx-database-mysql-produces-invalid-database-yml-under-windows/140010/1 "2008-06-10T02:29:36Z")

</div>

Hi All,

For days, I’ve been trying to get rake db:migration to work.

My first error was pointed out to my on this NG: I was using a dot  
rather than colon in the rake command.

My second error led me to conclude that their a problem in the rails  
command. I must be wrong, because there must be thousands or Rails  
on Windows users out there. But I can’t see it.

I ran the command:

C:\>rails var\www\cookbook --database=mysql

The generated C:\var\www\cookbook\config\database.yml has a space  
character following the colons in the non-comment statements. I  
confirmed this by viewing database.yml both with:

- Notepad
- XVI32.exe ( Hex editor which showed the char following the “:” were  
0x20 == ASCII Space)

I was led to this fact when I subsequently ran the following command  
and got results in a Command Window:

C:\var\www\cookbook\>ruby script/generate migration  
K:/\_Utilities/ruby186-26\_rc2/ruby/lib/ruby/gems/1.8/gems/  
activerecord-2.0.2/lib/active\_record/connection\_adapters/abstract/  
connection\_specification.rb  
:217:in `establish\_connection’: adapter:mysql encoding:utf8  
database:cookbook\_development username:root password:beer  
host:localhost database is not configured  
(ActiveRecord::AdapterNotSpecified)

I’m running:

- Rails 2.0.2 run over
- ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32] on top of
- WinXP-Pro/SP2

Thanks in Advance for any observations any of you might have.

Best wishes,  
Richard

---

<div class="post-metadata">

**Author:** ![RichardOnRails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e0b2c6/32.png) [@RichardOnRails](https://www.ruby-forum.com/u/RichardOnRails)\
**Post date:** [June 10, 2008, 5:23am UTC](https://www.ruby-forum.com/t/rails-xxx-database-mysql-produces-invalid-database-yml-under-windows/140010/2 "2008-06-10T05:23:17Z")

</div>

Hi All,

Please ignore everything I said. Somehow, I cleaned up my act (so  
far) and got a skeleton migration running.

I’ll probably screw-up something else as I continue this effort, but  
I can go to bed happily tonight.

Best wishes,  
Richard

On Jun 9, 8:28 pm, RichardOnRails

---

<div class="post-metadata">

**Author:** ![RichardOnRails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e0b2c6/32.png) [@RichardOnRails](https://www.ruby-forum.com/u/RichardOnRails)\
**Post date:** [June 11, 2008, 8:01pm UTC](https://www.ruby-forum.com/t/rails-xxx-database-mysql-produces-invalid-database-yml-under-windows/140010/3 "2008-06-11T20:01:33Z")

</div>

Hi All,

I finally discovered what was causing me to go crazy, causing me to  
post several false alarms. My Rake installation was corrupted. Once  
I reinstalled, all my problems disappeared.

Best wishes,  
Richard

On Jun 9, 11:22 pm, RichardOnRails
