加载“ mysql2”活动记录适配器时出错 [英] Error loading the 'mysql2' Active Record adapter
问题描述
我正在尝试升级我的应用程序,这是部署应用程序时遇到的错误:
I am trying to upgrade my app and this is the error I am getting while deploying the app:
加载'mysql2时出错'Active Record适配器。缺少它所依赖的宝石?无法激活mysql2(<0.6.0,> = 0.4.4),已经激活了mysql2-0.3.21。确保所有依赖项都已添加到Gemfile中。
Error loading the 'mysql2' Active Record adapter. Missing a gem it depends on? can't activate mysql2 (< 0.6.0, >= 0.4.4), already activated mysql2-0.3.21. Make sure all dependencies are added to Gemfile.
这是我的Gemfile:
https://github.com/BI-CTSICN/sparc-request/blob/master/Gemfile
here is my Gemfile: https://github.com/BI-CTSICN/sparc-request/blob/master/Gemfile
gem 'mysql2', '~> 0.3.18'
gem 'rails', '~> 5.1', '>= 5.1.4'
我正在使用ruby 2.4.2
I am using ruby 2.4.2
推荐答案
您使用的 mysql2
版本( 0.3.21
,在 Gemfile.lock
中签入)太旧,需要其中一个比 0.4.4 $ c $更新c>。
Your mysql2
version you use (0.3.21
, checked in Gemfile.lock
) is too old, required one is newer than 0.4.4
.
通过更改 Gemfile
中的版本来升级 mysql2
gem并运行捆绑更新mysql2
。当然,在那之前,请检查版本之间的变化,然后运行测试以检查升级是否没有任何问题。
Upgrade your mysql2
gem by changing version in Gemfile
and running bundle update mysql2
. Of course before that check what changed between versions and then run your tests to check if upgrade didn't break anything.
这篇关于加载“ mysql2”活动记录适配器时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!