本文介绍了Gem::LoadError: can't activate mysql2 (< 0.5, >= 0.3.18), 已经激活 mysql2-0.5.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我做了 bundle install 并且 mysql2 gem 从 0.4.10 更新到 0.5.0.

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

此后,任何涉及 ActiveRecord 的内容都会因标题中的错误而爆炸.

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

推荐答案

ActiveRecord 仅适用于 mysql2 的特定版本.

ActiveRecord only works with specific versions of mysql2.

在您的 Gemfile 中添加:

In your Gemfile add:

gem 'mysql2', '< 0.5'

捆绑安装.

我还建议添加指向此 URL 的评论,以便您了解为什么该 gem 被固定.

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

这篇关于Gem::LoadError: can't activate mysql2 (&lt; 0.5, &gt;= 0.3.18), 已经激活 mysql2-0.5.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-15 22:18