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

前端 未结 9 914
一整个雨季
一整个雨季 2020-12-02 06:13

In my gemfile I have:

gem \'mysql2\'

My database.yml is as follows:

default: &default
  adapter: mysql2
  database: <         


        
9条回答
  •  爱一瞬间的悲伤
    2020-12-02 06:50

    Had same issue but adding source 'https://rubygems.org' to the top of gem file solved issue.

    Steps:

    add source 'https://rubygems.org' to your gem file. Comment out mysql2 gem and add gem 'mysql2', '~> 0.3.18' Run bundle install

提交回复
热议问题