0

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?

2

3 Answers 3

5

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.

Sign up to request clarification or add additional context in comments.

Comments

3

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

Comments

1

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.