mysql2.so: libmysqlclient_r.so.15: cannot open shared object file: No such file or directory

If you encounter this error again after upgrading to 12.04 (or for people arriving here after googling the title of this page after upgrading to 12.04), the following worked for me:

gem uninstall mysql2
gem install mysql2

This will recompile the gem using libmysqlclient18, and worked for me.

Hope that helps someone out there.


You need to install the development libraries. Try

sudo apt-get install libmysqlclient20-dev

or

sudo apt-get install libmysqlclient19-dev

Install the mysql client libraries: apt-get install libmysqlclient16