Moon
Moon

Reputation: 22585

rails windows problem

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...

Upvotes: 0

Views: 159

Answers (3)

Edu
Edu

Reputation: 1969

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

Upvotes: 0

praavDa
praavDa

Reputation: 419

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?

Upvotes: 1

Dominik Grabiec
Dominik Grabiec

Reputation: 10665

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.

Upvotes: 1

Related Questions