Rails: Specified 'mysql2' for database ada

2019-03-04 17:20发布

问题:

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:

Add the following to your Gemfile:

gem 'mysql2', '~> 0.3.18'

Then run:

bundle install