117
116

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.

Rails mysql2でrake db:createがエラー問題

Last updated at Posted at 2015-09-08

現象

注意: 2015/9/9 0:00時点での現象です。

rails new hoge -d mysql

でrailsアプリケーションを新規で立ち上げ、

bundle exec rake db:create

すると、エラー?!

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).

いやいや、Gemfileの中に mysql2 ありますから。

bundle update

を行ってみても効果なし。

対応策

gem 'mysql2', '~> 0.3.20'

にてバージョン指定を行えば、エラーがなくなった。

mysql2のバージョンアップに伴って、不具合が発生しているようです。
おそらくすぐに対応されるかと思いますが、取り急ぎ解決策。

117
116
6

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
117
116

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?