Windows rails problem

I just installed ruby ​​on rails on windows.

install mysql and create a new project. Then I changed database.yml to use my own mysql server by following

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

when i try to access the history controller ( http: // localhost: 3000 / stories ) the error shows

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

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

0


a source to share


3 answers


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

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

rails sample -d mysql

      



Taken from the Rails Getting Started Guide .

You can also see the section Configuring the MySQL Database in the same document.

+1


a source


From what I know - although I've been coding in rails for a long time, there are three separate bases there: development, production and testing. Maybe you are trying to use a test or products and you haven't configured them?



+1


a source


Have you tried restarting on the webserver?

Check if RAILS_ENV is set up for production, and if so, set it up for development:

set RAILS_ENV=development

      

0


a source







All Articles