Rails Ignoring Database.yml configurations and launching Webrick instead of MySQL
I'm pretty new to Rails and I'm still trying to get everything set up right on Snow Leopard. I'm trying to install Ruby, Rails, RVM, phpmyadmin, and MySQL. So far I have Ruby 1.9.2, Rails 3.0.9, RVM and MySQL (5.5.14?) installed and each of them seems to be working fine on their own.
My major obstacle is that I'm trying to start-up MySQL in my test rails app and it's completely ignoring my database.yml file configurations (shown below) and is launching Webrick instead. I saved this database.yml file and did 'bundle install' and it says that everything is loaded.
database.yml contents:
development:
adapter: mysql2
database: db/development_database
username: root
password: ###### [password hidden]
pool: 5
timeout: 5000
test:
adapter: mysql2
database: db/test_database
username: root
password: ###### [password hid开发者_如何转开发den]
pool: 5
timeout: 5000
production:
adapter: mysql2
database: db/production_database
username: root
password: ####### [password hidden]
pool: 5
timeout: 5000
FYI: I was having this issue version of mysql2 (0.3.2) doesn't ship with the ActiveRecord adapter bundled anymore as it's now part of Rails 3.1 which I was trying to troubleshoot when rails wouldn't stop loading webrick.
Any help as to what I'm doing wrong?
Quick clarification:
MySQL is the db and WEBrick is the web server. They can both be in use simultaneously. What leads you to think that mysql isn't running? Have you done rake db:create, have any models/migrations in place?
MySQL is actually replacing SQLite3, not WEBrick...
I just noticed that you're using "db/development_database" as the database name. Usually if you're using mysql as your database server, you'd simply put the name of the database. I've never tried to, but I'm pretty sure, you can't use the '/'.
精彩评论