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

后端 未结 14 2579
醉酒成梦
醉酒成梦 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 08:45

    Change to

    gem 'mysql2', '~> 0.3.18'
    

    in your Gemfile.

    This thread on the official mysql2 Github says to do this. You need to declare that version number if you're rails version 4.x.x.

    https://github.com/brianmario/mysql2/issues/675

    Then run bundle update mysql2.

提交回复
热议问题