Rails 3.2.3 MySQL 5.5.1 Error installing gys gysys with incompatibility ld error

I have a clean build system as follows

Ubuntu 11.04

Rvm 1.13.5

Ruby 1.9.3p194

Rails 3.2.3

Gemstone 1.8.24

MySql 5.5.24-1 (installed in / usr / local)

I am trying to install gem mysql2 (0.3.11) and get the following problem:

 pal@smurf01:~$ sudo gem install mysql2
   [sudo] password for pal: 
   Building native extensions.  This could take a while...
   ERROR:  Error installing mysql2:
        ERROR: Failed to build gem native extension.

        /usr/local/rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb
   checking for rb_thread_blocking_region()... yes
   checking for rb_wait_for_single_fd()... yes
   checking for mysql.h... yes
   checking for errmsg.h... yes
   checking for mysqld_error.h... yes
   creating Makefile

   make
   compiling client.c
   client.c: In function 'rb_raise_mysql2_error':
   client.c:98:3: warning: ISO C90 forbids mixed declarations and code
   client.c: In function 'rb_mysql_client_socket':
   client.c:590:3: warning: ISO C90 forbids mixed declarations and code
   compiling mysql2_ext.c
   compiling result.c
   linking shared-object mysql2/mysql2.so
   /usr/bin/ld: skipping incompatible /usr/local/mysql/lib/libmysqlclient_r.so when searching for -lmysqlclient_r
   /usr/bin/ld: skipping incompatible /usr/local/mysql/lib/libmysqlclient_r.a when searching for -lmysqlclient_r
   /usr/bin/ld: cannot find -lmysqlclient_r
   collect2: ld returned 1 exit status
   make: *** [mysql2.so] Error 1


   Gem files will remain installed in /usr/local/rvm/gems/ruby-1.9.3-p194/gems/mysql2-0.3.11 for inspection.
   Results logged to /usr/local/rvm/gems/ruby-1.9.3-p194/gems/mysql2-0.3.11/ext/mysql2/gem_make.out
 pal@smurf01:~$

First question: Has anyone got Rails mysql2 working with MySql 5.5.1 on Ubuntu? It works for me on another system with 5.1. The gem description is undefined in supported versions of MySql.

Second question: Has anyone encountered this problem? I ± have encountered various library problems with the mysql2 stone over the past year or so, but this seems to be different.

Any help is greatly appreciated.

BTW: Returning to MySql 5.1 is a valid solution!

Yours faithfully

Peter

+3
4

, . .

libmysqlclient-dev deb, Nathan Rennie Waldock

 wget http://ppa.launchpad.net/nathan-renniewaldock/ppa/ubuntu/pool/main/m/mysql-5.5/libmysqlclient-dev_5.5.24-1~ppa1~natty_amd64.deb./;l
 dpkg -i libmysqlclient-dev_5.5.24-1~ppa1~natty_amd64.deb

, mysql2, mysql

cd /usr/lib/
ln -s /usr/local/mysql-5.5.24-linux2.6-x86_64/lib/libmysqlclient_r.a .
ln -s /usr/local/mysql-5.5.24-linux2.6-x86_64/lib/libmysqlclient_r.so .
ln -s /usr/local/mysql-5.5.24-linux2.6-x86_64/lib/libmysqlclient_r.so.18 .
ln -s /usr/local/mysql-5.5.24-linux2.6-x86_64/lib/libmysqlclient_r.so.18.0.0 .

gem mysql2

sudo gem install mysql2
  Fetching: mysql2-0.3.11.gem (100%)
  Building native extensions.  This could take a while...
  Successfully installed mysql2-0.3.11
  1 gem installed
  Installing ri documentation for mysq2l-0.3.11...
  Installing RDoc documentation for mysql2-0.3.11...
+2

apt-get install libmysqlclient-dev, gem install mysql2

+14

Ubuntu 12.04 ppa, . libmysqlclient _r . , , _r , 11.10 12.04.

, , , :

ln -s /usr/lib/x86_64-linux-gnu/libmysqlclient.a ./libmysqlclient_r.a
ln -s /usr/lib/x86_64-linux-gnu/libmysqlclient.so ./libmysqlclient_r.so
ln -s /usr/lib/x86_64-linux-gnu/libmysqlclient.so.18 ./libmysqlclient_r.so.18
ln -s /usr/lib/x86_64-linux-gnu/libmysqlclient.so.18.0.0 ./libmysqlclient_r.so.18.0.0
0

...

dpkg -r mysql-devel, apt-get install libmysqlclient-dev :

libmysqlclient-dev (.../libmysqlclient-dev_5.5.24-0ubuntu0.12.04.1_i386.deb)... dpkg: /var/cache/apt/archives/libmysqlclient -dev_5.5.24-0ubuntu0.12.04.1_i386.deb(-unpack): '/usr/bin/mysql_config', mysql-devel 5.5.28-2

gem install mysql2 ! yay:)

0

All Articles