Gem::LoadError: can't activate mysql2 (< 0.5, >= 0.3.18), already activated mysql2-0.5.0

和自甴很熟 提交于 2020-03-03 12:50:47

问题


I did bundle install and the mysql2 gem was updated from 0.4.10 to 0.5.0.

After this anything involving ActiveRecord blows up with the error in the title.


回答1:


ActiveRecord only works with specific versions of mysql2.

In your Gemfile add:

gem 'mysql2', '< 0.5'

and bundle install.

I would also recommend adding a comment pointing to this URL so you know why the gem is pinned.



来源:https://stackoverflow.com/questions/49407254/gemloaderror-cant-activate-mysql2-0-5-0-3-18-already-activated-mysq

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!