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

后端 未结 14 2592
醉酒成梦
醉酒成梦 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!

提交回复
热议问题