Reputation: 177
To make a Rails application with MySQL, I do the following:
rails new application -database=mysql
That doesn't work though, instead it gives my SQLite. I don't want SQLite, I want MySQL.
How can I solve this?
Upvotes: 0
Views: 2177
Reputation: 248
First of all you need to install mysql2 in your system
sudo gem install mysql2 -v=0.2.11
Once you have installed mysql2, then you are ready to create a new app with Mysql as default
rails new sample_app -d mysql
Upvotes: 3
Reputation: 1174
I think you are looking at the command to create new rails app with mysql configuration in database.yml
rails new app --database mysql
I hope it answers your query.
Upvotes: 5
Reputation: 395
If you use bundler, then you should add
gem "mysql2"
to your Gemfile and run
bundle install
and then specify your database settings in config/database.yml
Upvotes: 1