Mysql2 gem not working after upgrading to Ubuntu 16.04 - libmysqlclient.so.18

Everything worked fine until the update. Using ruby โ€‹โ€‹1.9.3p392 with RVM with rails (3.2.12) Using MySQL 5.7.16 and Nginx and Unicorn

Magazine shows

LoadError: libmysqlclient.so.18: cannot open the shared objects file: there is no such file or directory - / home / bill / apps / xxx / shared / bundle / ruby โ€‹โ€‹/ 1.9.1 / gems / mysql2-0.3.16 / Library / mysql2 /mysql2.so

I tried: 1. uninstall / install mysql2 gem 2. Install the package

Nothing succeeded. Has anyone had this problem after updating?

+6
source share
1 answer

Uninstall and reinstall mysql2 gem.

I had the same thing. Updated from Ubuntu 14 to 16 and saw this error.

To fix this, I just removed the mysql2 pearl and reinstalled it with bundler.

  • Remove mysql2 gem:

    $ bundle exec gem uninstall mysql2

  • Install mysql2 gem:

    $ bundle install

The reason is that he must install his own extensions when he installs a gem, and a big change in the system, for example, updating OS 1 or more versions, requires rebuilding these internal extensions.

Hope this helps.

+12
source

Source: https://habr.com/ru/post/1013890/


All Articles