views:

59

answers:

3

Hello,

I just installed ruby on rails on windows.

install mysql and created a new project. Then I changed database.yml to use my own mysql server as follow

development: adapter: mysql database: mytools username: test password: test

when I try to access story controller(http://localhost:3000/stories), error shows

"SQLite3::SQLException: no such table: stories: SELECT * FROM "stories" "

Why am I getting this error? I am not using mysql...

+1  A: 

By default Rails creates and uses a SQLite database not a MySQL one.

You can specify the database to use with the -d flag when creating your Rails application. For example to create a rails app called "sample" using mysql as the database:

rails sample -d mysql

Taken from the Getting Started with Rails guide.

You might also want to check out the section on Configuring a MySQL Database in the same document.

Daemin
how did I miss that??Thank you!!
Moon
+1  A: 

From what I know - though I was coding in rails long ago, there are 3 separate databases there: development, production and test. Maybe You are trying to use test or production and You didn't configured them?

praavDa
A: 

Did you try a restart on the webserver?

Check if the RAILS_ENV is set to production and if it is, set it for development:

set RAILS_ENV=development
Edu