Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationEventAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
117
Help us understand the problem. What is going on with this article?

More than 5 years have passed since last update.

@shizuma

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

現象

注意: 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
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
117
Help us understand the problem. What is going on with this article?