Women in Technology

Hear us Roar



Article:
  Cookin' with Ruby on Rails - Designing for Testability
Subject:   database.yml
Date:   2008-06-26 14:32:11
From:   wonger
I've been following the tutorial at http://instantrails.rubyforge.org/tutorial/index.html


I created the new database cookbook2. Then, I edited the database.yml file. However, after this step, I can not restart the web server.


I think that there has been some sort of change in the syntax that I need to use in the database.yml file. I am using mySql Front version 4.2 and I downloaded Instant Rails. The tutorial says to edit the database.yml file to look like this:


development:
adaper: mysql
database: cookbook2
username: root
password:
host: localhost


test:
adaper: mysql
database: cookbook2
username: root
password:
host: localhost


production:
adaper: mysql
database: cookbook2
username: root
password:
host: localhost


I did that and then I try to run ruby script\server and I get an error message. c:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapers/abstract/connection_specification.rb:217:in 'establish_connection': develpment database is not configured (activeRecord::AdpaterNotSpecified)


Before I edited it, the database.yml file looked like this:
# SQLite version 3.x
# gem install sqlite3-ruby (not necessary on OS X Leopard)
development:
adapter: sqlite3
database: db/development.sqlite3
timeout: 5000


# Warning: The database defined as 'test' will be erased and
# re-generated from your development database when you run 'rake'.
# Do not set this db to the same as development or production.
test:
adapter: sqlite3
database: db/test.sqlite3
timeout: 5000


production:
adapter: sqlite3
database: db/production.sqlite3
timeout: 5000


What am I doing wrong? Thanks.