ItGo.me Focus on IT Recommend

Home > MariaDB 10.1 and MySQL2 gem with rails on Ubuntu 14.04

MariaDB 10.1 and MySQL2 gem with rails on Ubuntu 14.04

I can't run my Rails 4.2/MariaDB app on Ubuntu 14.04. I installed MariaDB 10.1.9.

apt-get install software-properties-common
apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db
add-apt-repository 'deb [arch=amd64,i386] http://ftp.igh.cnrs.fr/pub/mariadb/repo/10.1/ubuntu trusty main'
apt-get update
apt-get install mariadb-server

Also the client:

apt-get install libmariadbclient-dev

MariaDB is working great.

But the MySQL2 gem doesn't work:

I installed it with:

gem uninstall mysql2

gem install mysql2 -v='0.3.18' -- --with-mysql-config=/usr/bin/mysql_config

Fetching: mysql2-0.3.18.gem (100%)
Building native extensions with: '--with-mysql-config=/usr/bin/mysql_config'
This could take a while...
Successfully installed mysql2-0.3.18
1 gem installed

It works. I opened the mysql_config file and it contains the 10.1.9 version.

But when I deploy my app, I have this "classical" error:

Incorrect MySQL client library version! This gem was compiled for 5.5.46 but the client library is 10.1.9-MariaDB.

but I compiled it for MariaDB 10.1.9 !!!

In addition, note that I have installed also "libmysqlclient18" before "libmariadbclient-dev"... don't know if this can be a problem.

Thanks

Recommend:ruby on rails - How do I install the mysql2 gem on ubuntu, when I'm using rails3 via rvm

far, I'm managed to set up rvm on ubuntu (for some reason, ruby is outdated in the ubuntu repo's). I've managed to set up a rails project. I want my test project to use mysql rather then mysqlite. When I tried 'rake db:migrate', I got an er

oriUlr:http://stackoverflow.com/questions/33918779/mariadb-10-1-and-mysql2-gem-with-rails-on-ubuntu-14-04

------splitte line----------------------------