Topic: rake db:create:all problem...


I'm new to rails. Have worked through the depot example in the AWDWR using an older version of ruby on rails due to the scaffolding being changed in RoR 2.02...

Now I'm trying to learn the "new" features and having troubles getting things up and running.

Basically what I've done is installing the BitNami Rubystack in windows. I've then updated using gem update --system. I've set up MySql privliges, no databases or tables.

Then I've started a new project using: rails newproject. This works fine and it makes the new directories and files. Inside I've edited the datamase.yml file to look like the following:
## File start ##
defaults: &defaults
  adapter: mysql
  username: root
  password: sqlpass
  host: localhost
  port: 80
  timeout: 5000

  database: newproject_development
  <<: *defaults

  database: newproject_test
  <<: *defaults

  database: newproject_production
  <<: *defaults
## File end ##

After doing this I thought I was ready to run the command: rake db:create:all for rails to create the databases and do it's "magic". But there's a problem...

Using --trace I get the following:
(in D:/RubyOnRails/newproject>
** Invoke db:create:all <first time>
** Invoke environment <first time>
** Execute enviroment
** Execute db:create:all

then it thinks for a long time, litteraly 5-10 minutes before dumping
rake aborted!
+ probably 20 lines of paths to gems/rails and gems/ruby
and the it asks me:
Terminate batch job <Y/N>?

So, lots of information there... anyone got a clue what I'm doing wrong?


Re: rake db:create:all problem...

I've never seen anything like that before.

But, to get it working, I suggest you forgo the DRY for this file and paste your defaults into each database type.

You said it worked before, but if you have even one single space out of place, i find yml or db:create:all breaks.

that happened to me, when i cut and paste'd 'good' database.yml file info into a new project.

check your beginning white space and make sure it aligns properly.

Re: rake db:create:all problem...

Actually, I got it to work now. The problem seems to be that i initially did not start my project by using "-d mysql" option... so, "rails newproject -d mysql" did the trick..