-
Notifications
You must be signed in to change notification settings - Fork 550
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
uninitialized constant Mysql2::Client::SECURE_CONNECTION #754
Comments
Duplicate of #603. (When you did a brew update, you upgraded MySQL. Now upgrade the mysql2 library to support it.) |
It seems the issue went away when upgrading the mysql2 gem to 0.3.18. When I updated it to latest version, I got a gemload error, and I assume the latest version is only compatible with Rails 5, whereas I am using Rails 4: |
This particular issue for supporting MySQL 5.7 was added in 0.3.17 and higher.
As for mysql2 0.3.x / 0.4.x, here's the compatibility table for Rails and mysql2 versions: https://github.com/brianmario/mysql2/blob/master/README.md#compatibility
|
Changing the version to gem 'mysql2', '~> 0.3.21' |
gem 'mysql2', '~> 0.3.21' This worked for me as well. |
And here too |
@deepakmahakale : yeah... I've just got that one into my hands, I even didn't know it was using a ruby that old until today... :-/ |
I ran the following command on OSX 10.9.5:
brew update && brew upgrade && brew install imagemagick
Since that point, rails server and rails console raises errors.
Below is the first few lines of the error:
Users/donato/.rvm/gems/ruby-2.1.2@core/gems/mysql2-0.3.16/lib/mysql2/client.rb:12:in
<class:Client>': uninitialized constant Mysql2::Client::SECURE_CONNECTION (NameError) from /Users/donato/.rvm/gems/ruby-2.1.2@core/gems/mysql2-0.3.16/lib/mysql2/client.rb:2:in
module:Mysql2'from /Users/donato/.rvm/gems/ruby-2.1.2@core/gems/mysql2-0.3.16/lib/mysql2/client.rb:1:in
<top (required)>' from /Users/donato/.rvm/gems/ruby-2.1.2@core/gems/mysql2-0.3.16/lib/mysql2.rb:10:in
require'from /Users/donato/.rvm/gems/ruby-2.1.2@core/gems/mysql2-0.3.16/lib/mysql2.rb:10:in `<top (required)>'
This is the mysql gem I am using (which was working fine until the brew update):
gem 'mysql2', '0.3.16'
How can I resolve this?
The text was updated successfully, but these errors were encountered: