Gem::LoadError for mysql2 gem, but it's already in Gemfile

后端 未结 14 2538
醉酒成梦
醉酒成梦 2020-12-02 08:35
Gem::LoadError
Specified \'mysql2\' for database adapter, but the gem is not loaded.
Add `gem \'mysql2\'` to your Gemfile

This error occurred while

相关标签:
14条回答
  • 2020-12-02 09:01

    I solved the problem, installing the mysql2 gem local (gem install mysql2, bundle install) and adding the following line to the Gemfile:

    gem 'mysql2'

    Setting the mysql2 adapter in database.yml

    adapter: mysql2

    was also important!

    0 讨论(0)
  • 2020-12-02 09:02

    I have previously installed mysql2 0.4.5 but that was giving me this error so i have installed another version of mysql2 by:

    gem install mysql2 --version 0.3.20

    Hope this solves your problem.

    0 讨论(0)
提交回复
热议问题