未初始化的常量Mysql2 :: Client :: SECURE_CONNECTION [英] uninitialized constant Mysql2::Client::SECURE_CONNECTION
本文介绍了未初始化的常量Mysql2 :: Client :: SECURE_CONNECTION的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
由于mysql2
这篇文章对我没有帮助: rake已中止!未初始化的常量Mysql2
This post didn't help me: rake aborted! uninitialized constant Mysql2
它在我的同事计算机上也可以正常工作,因此排除了项目本身的问题.
Also it works fine on my co-workers computers, so an issue with the project itself is excluded.
这是控制台输出:
$ rails s
/home/duke/.rvm/gems/ruby-2.0.0-p648/gems/bundler-1.13.6/lib/bundler/runtime.rb:94:in `rescue in block (2 levels) in require': There was an error while trying to load the gem 'mysql2'. (Bundler::GemRequireError)
Gem Load Error is: uninitialized constant Mysql2::Client::SECURE_CONNECTION
Backtrace for gem load error is:
/home/duke/.rvm/gems/ruby-2.0.0-p648/gems/mysql2-0.3.14/lib/mysql2/client.rb:12:in `<class:Client>'
/home/duke/.rvm/gems/ruby-2.0.0-p648/gems/mysql2-0.3.14/lib/mysql2/client.rb:2:in `<module:Mysql2>'
/home/duke/.rvm/gems/ruby-2.0.0-p648/gems/mysql2-0.3.14/lib/mysql2/client.rb:1:in `<top (required)>'
/home/duke/.rvm/gems/ruby-2.0.0-p648/gems/mysql2-0.3.14/lib/mysql2.rb:10:in `require'
/home/duke/.rvm/gems/ruby-2.0.0-p648/gems/mysql2-0.3.14/lib/mysql2.rb:10:in `<top (required)>'
/home/duke/.rvm/gems/ruby-2.0.0-p648/gems/bundler-1.13.6/lib/bundler/runtime.rb:91:in `require'
/home/duke/.rvm/gems/ruby-2.0.0-p648/gems/bundler-1.13.6/lib/bundler/runtime.rb:91:in `block (2 levels) in require'
/home/duke/.rvm/gems/ruby-2.0.0-p648/gems/bundler-1.13.6/lib/bundler/runtime.rb:86:in `each'
/home/duke/.rvm/gems/ruby-2.0.0-p648/gems/bundler-1.13.6/lib/bundler/runtime.rb:86:in `block in require'
/home/duke/.rvm/gems/ruby-2.0.0-p648/gems/bundler-1.13.6/lib/bundler/runtime.rb:75:in `each'
/home/duke/.rvm/gems/ruby-2.0.0-p648/gems/bundler-1.13.6/lib/bundler/runtime.rb:75:in `require'
/home/duke/.rvm/gems/ruby-2.0.0-p648/gems/bundler-1.13.6/lib/bundler.rb:106:in `require'
/home/duke/RubymineProjects/*******/*******/config/application.rb:7:in `<top (required)>'
/home/duke/.rvm/gems/ruby-2.0.0-p648/gems/railties-3.2.15/lib/rails/commands.rb:53:in `require'
/home/duke/.rvm/gems/ruby-2.0.0-p648/gems/railties-3.2.15/lib/rails/commands.rb:53:in `block in <top (required)>'
/home/duke/.rvm/gems/ruby-2.0.0-p648/gems/railties-3.2.15/lib/rails/commands.rb:50:in `tap'
/home/duke/.rvm/gems/ruby-2.0.0-p648/gems/railties-3.2.15/lib/rails/commands.rb:50:in `<top (required)>'
script/rails:6:in `require'
script/rails:6:in `<main>'
Bundler Error Backtrace:
from /home/duke/.rvm/gems/ruby-2.0.0-p648/gems/bundler-1.13.6/lib/bundler/runtime.rb:90:in `block (2 levels) in require'
from /home/duke/.rvm/gems/ruby-2.0.0-p648/gems/bundler-1.13.6/lib/bundler/runtime.rb:86:in `each'
from /home/duke/.rvm/gems/ruby-2.0.0-p648/gems/bundler-1.13.6/lib/bundler/runtime.rb:86:in `block in require'
from /home/duke/.rvm/gems/ruby-2.0.0-p648/gems/bundler-1.13.6/lib/bundler/runtime.rb:75:in `each'
from /home/duke/.rvm/gems/ruby-2.0.0-p648/gems/bundler-1.13.6/lib/bundler/runtime.rb:75:in `require'
from /home/duke/.rvm/gems/ruby-2.0.0-p648/gems/bundler-1.13.6/lib/bundler.rb:106:in `require'
from /home/duke/RubymineProjects/********/********/config/application.rb:7:in `<top (required)>'
from /home/duke/.rvm/gems/ruby-2.0.0-p648/gems/railties-3.2.15/lib/rails/commands.rb:53:in `require'
from /home/duke/.rvm/gems/ruby-2.0.0-p648/gems/railties-3.2.15/lib/rails/commands.rb:53:in `block in <top (required)>'
from /home/duke/.rvm/gems/ruby-2.0.0-p648/gems/railties-3.2.15/lib/rails/commands.rb:50:in `tap'
from /home/duke/.rvm/gems/ruby-2.0.0-p648/gems/railties-3.2.15/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
我已经尝试了GitHub Issues的每条建议,但根本没有帮助.
I've tried every single advice from GitHub Issues, but it didn't help at all.
- 我尝试了Ruby 2.0.0、2.1.8、2.2.x
- 我的操作系统是Ubuntu 16.04
- MySQL 5.6.16
-
ruby-mysql
和libmysqlclient-dev
都已安装
- I tried Ruby 2.0.0, 2.1.8, 2.2.x
- My OS is Ubuntu 16.04
- MySQL 5.6.16
ruby-mysql
andlibmysqlclient-dev
are both installed
推荐答案
我必须将mysql2
更新为0.3.21
这篇关于未初始化的常量Mysql2 :: Client :: SECURE_CONNECTION的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文