Rails: Specified 'mysql2' for database adapter but the gem is not loaded

别来无恙 提交于 2019-12-20 06:15:43

问题


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


来源:https://stackoverflow.com/questions/32835912/rails-specified-mysql2-for-database-adapter-but-the-gem-is-not-loaded

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!