9
9

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Rails4 で mysql2 gem を指定してるのに「Gem::LoadError Specified 'mysql2'」とでたら gem バージョンを下げると直るかも

Last updated at Posted at 2016-01-10

※ 修正更新したが内容は 2016 年のものです。

Gem::LoadError Specified 'mysql2' for database adapter, but the gem is not loaded.

Rails4 で MySQL を利用するとき

Gem::LoadError
Specified 'mysql2' for database adapter, but the gem is not loaded.
Add gem 'mysql2' to your Gemfile

と出る場合 gem mysql2 のバージョンを下げると利用できるらしい。

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

上記回答コメントによると Rails 4.0.x, 4.1.x, 4.2.x で発生し gem mysql2 バージョン 0.3.x を利用すれば解決する。

なおバージョン 0.3 の現在の最新版は以下。
gem 'mysql2', '~> 0.3.20'

9
9
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
9

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?