Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Fixing "Incorrect MySQL client library version! This gem was compiled for 5.5.29 but the client library is 5.6.10. (RuntimeError)" on OS X while using Brew
ARCHFLAGS="-arch x86_64" gem install mysql2 -- –with-mysql-config=/usr/local/bin/mysql_config
@p5k6

This comment has been minimized.

Copy link

commented Feb 26, 2013

Thanks for this - fixed things up real quick for me!

@mcnute

This comment has been minimized.

Copy link

commented Mar 5, 2013

Thank you so much! It worked like a charme.

@mrchess

This comment has been minimized.

Copy link

commented Mar 9, 2013

Thanks as well.

@brunomvsouza

This comment has been minimized.

Copy link

commented Mar 10, 2013

Worked like a charm. Thank you! :)

@ribbitfix

This comment has been minimized.

Copy link

commented Mar 17, 2013

Thank you!

@rafeequl

This comment has been minimized.

Copy link

commented Mar 28, 2013

Thank you!

@gaahrdner

This comment has been minimized.

Copy link

commented Apr 3, 2013

Thanks, worked great!

@abtris

This comment has been minimized.

Copy link

commented Apr 9, 2013

Thanks!

@naoiwata

This comment has been minimized.

Copy link

commented May 4, 2013

thank u!!!

@metinucar

This comment has been minimized.

Copy link

commented May 8, 2013

thanks!

@panggi

This comment has been minimized.

Copy link

commented May 14, 2013

Thanks a lot! :)

@FrancisGX

This comment has been minimized.

Copy link

commented Jun 11, 2013

Thank you!!

@caoer

This comment has been minimized.

Copy link

commented Jun 11, 2013

Thanks!!

@aleksanderreksc

This comment has been minimized.

Copy link

commented Jun 14, 2013

+1 :)

@JDStraughan

This comment has been minimized.

Copy link

commented Jun 21, 2013

+1 Thanks!

@firecall

This comment has been minimized.

Copy link

commented Jul 30, 2013

+1

@Sparkboxx

This comment has been minimized.

Copy link

commented Nov 2, 2013

Thanks!

@msupko

This comment has been minimized.

Copy link

commented Dec 4, 2013

The above did not work for me without adding env. I had to use:

env ARCHFLAGS="-arch x86_64" gem install mysql2 -- --with-mysql-config=/usr/local/bin/mysql_config
@casoetan

This comment has been minimized.

Copy link

commented Mar 29, 2014

@msupko worked for me too.

@vinchi777

This comment has been minimized.

Copy link

commented Apr 9, 2014

thanks

@jayrmotta

This comment has been minimized.

Copy link

commented Dec 8, 2014

This is sad :(

[jayrmotta] ~/zup-codes/cockpit/cockpit-api ruby-2.1.2 (master) $ ~/Downloads/mysql2-gem-install.sh
Building native extensions with: '-with-mysql-config=/usr/local/bin/mysql_config'
This could take a while...
Successfully installed mysql2-0.3.17
Parsing documentation for mysql2-0.3.17
Done installing documentation for mysql2 after 1 seconds
1 gem installed


[jayrmotta] ~/zup-codes/cockpit/cockpit-api ruby-2.1.2 (master) $ bundle exec rspec
/Users/jayrmotta/.rvm/gems/ruby-2.1.2/gems/mysql2-0.3.17/lib/mysql2.rb:8:in `require': Incorrect MySQL client library version! This gem was compiled for 5.5.28 but the client library is 5.6.20. (RuntimeError)
    from /Users/jayrmotta/.rvm/gems/ruby-2.1.2/gems/mysql2-0.3.17/lib/mysql2.rb:8:in `<top (required)>'
    from /Users/jayrmotta/.rvm/gems/ruby-2.1.2@global/gems/bundler-1.6.2/lib/bundler/runtime.rb:76:in `require'
    from /Users/jayrmotta/.rvm/gems/ruby-2.1.2@global/gems/bundler-1.6.2/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
    from /Users/jayrmotta/.rvm/gems/ruby-2.1.2@global/gems/bundler-1.6.2/lib/bundler/runtime.rb:72:in `each'
    from /Users/jayrmotta/.rvm/gems/ruby-2.1.2@global/gems/bundler-1.6.2/lib/bundler/runtime.rb:72:in `block in require'
    from /Users/jayrmotta/.rvm/gems/ruby-2.1.2@global/gems/bundler-1.6.2/lib/bundler/runtime.rb:61:in `each'
    from /Users/jayrmotta/.rvm/gems/ruby-2.1.2@global/gems/bundler-1.6.2/lib/bundler/runtime.rb:61:in `require'
    from /Users/jayrmotta/.rvm/gems/ruby-2.1.2@global/gems/bundler-1.6.2/lib/bundler.rb:132:in `require'
    from /Users/jayrmotta/Documents/codes/zup/cockpit/cockpit-api/config/application.rb:14:in `<top (required)>'
    from /Users/jayrmotta/Documents/codes/zup/cockpit/cockpit-api/config/environment.rb:2:in `require'
    from /Users/jayrmotta/Documents/codes/zup/cockpit/cockpit-api/config/environment.rb:2:in `<top (required)>'
    from /Users/jayrmotta/Documents/codes/zup/cockpit/cockpit-api/spec/rails_helper.rb:5:in `require'
    from /Users/jayrmotta/Documents/codes/zup/cockpit/cockpit-api/spec/rails_helper.rb:5:in `<top (required)>'
    from /Users/jayrmotta/Documents/codes/zup/cockpit/cockpit-api/spec/helpers/events_transformer_spec.rb:1:in `require'
    from /Users/jayrmotta/Documents/codes/zup/cockpit/cockpit-api/spec/helpers/events_transformer_spec.rb:1:in `<top (required)>'
    from /Users/jayrmotta/.rvm/gems/ruby-2.1.2/gems/rspec-core-3.1.7/lib/rspec/core/configuration.rb:1105:in `load'
    from /Users/jayrmotta/.rvm/gems/ruby-2.1.2/gems/rspec-core-3.1.7/lib/rspec/core/configuration.rb:1105:in `block in load_spec_files'
    from /Users/jayrmotta/.rvm/gems/ruby-2.1.2/gems/rspec-core-3.1.7/lib/rspec/core/configuration.rb:1105:in `each'
    from /Users/jayrmotta/.rvm/gems/ruby-2.1.2/gems/rspec-core-3.1.7/lib/rspec/core/configuration.rb:1105:in `load_spec_files'
    from /Users/jayrmotta/.rvm/gems/ruby-2.1.2/gems/rspec-core-3.1.7/lib/rspec/core/runner.rb:96:in `setup'
    from /Users/jayrmotta/.rvm/gems/ruby-2.1.2/gems/rspec-core-3.1.7/lib/rspec/core/runner.rb:84:in `run'
    from /Users/jayrmotta/.rvm/gems/ruby-2.1.2/gems/rspec-core-3.1.7/lib/rspec/core/runner.rb:69:in `run'
    from /Users/jayrmotta/.rvm/gems/ruby-2.1.2/gems/rspec-core-3.1.7/lib/rspec/core/runner.rb:37:in `invoke'
    from /Users/jayrmotta/.rvm/gems/ruby-2.1.2/gems/rspec-core-3.1.7/exe/rspec:4:in `<top (required)>'
    from /Users/jayrmotta/.rvm/gems/ruby-2.1.2/bin/rspec:23:in `load'
    from /Users/jayrmotta/.rvm/gems/ruby-2.1.2/bin/rspec:23:in `<main>'
    from /Users/jayrmotta/.rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in `eval'
    from /Users/jayrmotta/.rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in `<main>'
@ezmiller

This comment has been minimized.

Copy link

commented Feb 11, 2015

I'm getting this version of this error, and neither of the suggestions above helped, sadly:

Incorrect MySQL client library version! This gem was compiled for 5.5.27 but the client library is 5.6.22.

@ilyaruby

This comment has been minimized.

Copy link

commented Feb 3, 2016

There is an error in this gist.

Here, use "--with-mysql-config" instead of "–with-mysql-config" (note two short dashes instead of a long one).

If this fails to update a mysql2 then one could just use an another RVM ruby version or a new separate RVM gemset.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.