After upgrading to MySQL 5.6 from 5.5 we started getting an error: Incorrect MySQL client library version!

After upgrading to MySQL 5.6 from 5.5 we started getting an error:

Incorrect MySQL client library version!

This gem was compiled for 5.5.17 but the client library is 5.6.58. (RuntimeError)

Solution is pretty simple - reinstalling mysql2 gem.

The tricky part is how to do that.

bundle show mysql2

returned

... shared/bundle/ruby/2.2.0/gems/mysql2-0.3.18

After Uninstalling mysql2 gem bundle show still located the gem.

gem uninstall mysql2

Here is the trick

bundle exec gem uninstall mysql2

And don’t worry about the error:

ERROR: While executing gem ... (NoMethodError) undefined method delete’`

This is Rails after all. Just do bundle show mysql2 again to see that the gem was actually removed.

And finally:

bundle install

Welcome to The infinite monkey theorem

Somewhere a monkey just typed Shakespeare in TypeScript. Be the first to read the masterpieces (and the hilarious misfires) landing on the blog.

Subscribe to The infinite monkey theorem

We fling fresh posts—no banana peels attached—straight to your inbox.