Coding - 碼農筆記 / ruby & rails

筆記- rails 4.2.4 使用 mysql2 會報錯

使用 mysql2 會報錯誤訊息(rails 4.2.4)

參考網路上前輩們的解決方案,指定mysql版本,重新bundle install即可解決

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裡

原 gem 'mysql2'
改成 gem 'mysql2', '~> 0.3.18'
bundle install 即可

參考來源
© 2024 胡同筆記 | WordPress Theme: Cosimo by CrestaProject.