How do I resolve "incompatible library version" for mysql2 gem with ruby 2.3 on OS X?

croceldon picture croceldon · Dec 30, 2015 · Viewed 14.6k times · Source

I'm using ruby 2.3, and in the gemfile, I've got the mysql2 gem listed. But when I try to run rake db:migrate, I get the following:

/Users/me/.gem/ruby/2.3.0/gems/mysql2-0.4.2/lib/mysql2.rb:31:in `require': incompatible library version - /Users/me/.gem/ruby/2.3.0/gems/mysql2-0.4.2/lib/mysql2/mysql2.bundle (fatal)

I can't seem to get around this one. I've installed Mysql 5.7 with Homebrew, tried updating the bundle, uninstalling and reinstalling the mysql2 gem, all to no avail.

How can I get this resolved?

Answer

croceldon picture croceldon · Jan 22, 2016

I ended up solving this with gem pristine --all