0
votes

apparently there is a thread that addresses this issue . But I have already tried to run those commands given in the solution. I am still getting the same error for some reason.

I run gem install mysql2 -v 0.3.18

followed by bundle install

on my terminal. And than I start the server by typing rails server

Upon opening the localhost:3000. I receive the same error.

Specified 'mysql2' for database adapter, but the gem is not loaded. Add gem 'mysql2' to your Gemfile (and ensure its version is at the minimum required by ActiveRecord).

Any help would be much appreciated.

1
what is your rails version?K M Rakibul Islam
Rails 4.2.4 is my versionHaris Ghauri
Did you try adding gem 'mysql2', '~> 0.3.18' to your Gemfile and then running bundle install?K M Rakibul Islam
I just did. It removed the last error but gave me this:Haris Ghauri
rescue Mysql2::Error => error if error.message.include?("Unknown database") raise ActiveRecord::NoDatabaseError.new(error.message, error) else raise endHaris Ghauri

1 Answers

4
votes

Add the following to your Gemfile:

gem 'mysql2', '~> 0.3.18'

Then run:

bundle install