I am novice rails/terminal user and just did a clean install of Lion + Xcode + Rails. Unlike before (on Snow Leopard), I now get an error running rake db:migrate.
I have cloned my code through git which worked fine and created the database witht the "createdb" command but when I try run "rake db:migrate" in terminal it now comes up with this error:
rake aborted!
development database is not configured
My config/database.yml file looks like below in the development section which is exactly the way it looked before on Snow Leopard where it worked fine, so don't know if the error I am now getting is related to Lion.
development:
adapter: postgresql
database: my_db
username: rasmus
encoding: utf8
pool: 5
Can anyone help, please?
I got the same error and in my case it was because the database.yml was not indented correctly. All the configuration parameters should be indented.
Note, be sure to follow the proper spacing conventions. The database config is whitespace aware. Two spaces per attribute works fine. In the following code, note how each attribute has two spaces. Do not use tabs. If you don't use spaces for attributes, rake will not work and throw the same error.
development:
adapter: sqlite3
database: db/development.sqlite3
pool: 5
timeout: 5000
test:
adapter: sqlite3
database: db/test.sqlite3
pool: 5
timeout: 5000
production:
adapter: postgresql
encoding: unicode
database: db/production
pool: 5
timeout: 5000
password:
You might also want to look for syntax errors in the file. This is the error that will appear if you have a syntax error in your config/database.yml
file and you try to do something like start the local web server or run rake db:migrate
.
In my case I had accidentally removed the comment from a line at the top of the file and I was seeing this error since the uncommented line made this an invalid yml file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With