1

I am trying to install in my Gemfile the mysql gem. I type down this:

group :development, :test do

  #gem 'sqlite3-ruby', :require => 'sqlite3'

  #using mysql gem
  gem 'mysql', '2.8.1'

end

I run bundle install and everything runs ok. Ok when I run "rake db:reset" i get this:

Please install the sqlite3 adapter: `gem install activerecord-sqlite3-adapter` (sqlite3 is not part of the bundle. Add it to Gemfile.)

Tasks: TOP => db:drop => db:load_config
(See full trace by running task with --trace)

Now why would it even refer to sqlite3 since I am using mysql?

2 Answers 2

2

I would advise you to use the mysql2 gem, rather than the mysql one (see: What the difference between mysql and mysql2 gem)

Also you need to change the "config/database.yml" file, probably it now looks like this:

development:
  adapter: sqlite3
  database: db/development.sqlite3
  pool: 5
  timeout: 5000

Which means that Rails tries to use sqlite3 rather than mysql for your database. There's a section in the Rails guides on how to change this for MySQL: http://guides.rubyonrails.org/getting_started.html#configuring-a-database

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

Comments

0

it looks like you created a rails app without specifying that you were going to use MySql database. Just a thought...

Did you run

rails new APP_NAME -d mysql -- This will create the app configured to use MySQL

or

rails new APP_NAME -- This will create the app configured to use SQLLite3

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.