mysql2: incompatible library version

I started up an old project the other, and when I ran tests, I got an error about an incorrect client library version. I thought that made sense since I hadn’t run tests for awhile, so I uninstalled the mysql2 gem and bundled, which upgraded me to v0.4.2.

Now I get the following error:

/home/me/.rvm/gems/ruby-2.2.3/gems/mysql2-0.4.2/lib/mysql2.rb:31:in `require': incompatible library version - /home/me/.rvm/gems/ruby-2.2.3/gems/mysql2-0.4.2/lib/mysql2/mysql2.so (LoadError)

I’m running Arch Linux which just saw a large upgrade, so I thought it could be related to mariadb/client - but I haven’t found anything to support that. There are a few references to the same error around the web, including one closed issue here, but nothing that’s been resolved:

https://github.com/brianmario/mysql2/issues/657 how-do-i-resolve-incompatible-library-version-for-mysql2-gem-with-ruby-2-3

Can anyone point me in the right direction? I’ve tried versions of this gem down to 0.3.18, but still got the same error. Same with reinstalling mariadb/client and running mysql_upgrade

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 16 (2 by maintainers)

Most upvoted comments

Success. I uninstalled the system ruby and now it’s working as it should. Granted, I’m able to do that in my case (and others might not be able to), but the issue is that it was building with the system ruby and not the rvm ruby.