From: Peter Vandenabeele Date: 2012-01-26T04:05:51+09:00 Subject: Re: Install mysql2 gem in Ubuntu 11.10 with RVM --20cf300fb11bad459d04b75ef322 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Wed, Jan 25, 2012 at 7:36 PM, Jim Wharton wrote= : > I'm trying to get this gem installed and it keeps puking up errors. All > the searches I've done tell me that I need to have the > libmysqlclient-dev libraries installed. I do. But when I attempt to gem > install mysql2: > > jim@caesar ~/Sites/igpt/install/shapefiles[testoo*]$ gem install mysql2 > -- --with-mysql-config=3D/usr/bin/mysql_config > Building native extensions. This could take a while... > ERROR: Error installing mysql2: > ERROR: Failed to build gem native extension. > > /home/jim/.rvm/rubies/ruby-1.8.7-p334/bin/ruby extconf.rb > --with-mysql-config=3D/usr/bin/mysql_config > checking for rb_thread_blocking_region()... no > checking for rb_wait_for_single_fd()... no > checking for mysql.h... yes > checking for errmsg.h... yes > checking for mysqld_error.h... yes > creating Makefile > > make > gcc -I. -I. > -I/home/jim/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/i686-linux -I. > -DHAVE_MYSQL_H -DHAVE_ERRMSG_H -DHAVE_MYSQLD_ERROR_H > -D_FILE_OFFSET_BITS=3D64 -I/usr/include/mysql -DBIG_JOINS=3D1 > -fno-strict-aliasing -DUNIV_LINUX -DUNIV_LINUX -fPIC -g -O2 -fPIC > -Wall -funroll-loops -c result.c > result.c: In function =E2=80=98rb_mysql_result_fetch_row=E2=80=99: > result.c:258:31: warning: variable =E2=80=98tokens=E2=80=99 set but not u= sed > [-Wunused-but-set-variable] > result.c:272:58: warning: variable =E2=80=98tokens=E2=80=99 set but not u= sed > [-Wunused-but-set-variable] > result.c:315:33: warning: variable =E2=80=98tokens=E2=80=99 set but not u= sed > [-Wunused-but-set-variable] > gcc -I. -I. > -I/home/jim/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/i686-linux -I. > -DHAVE_MYSQL_H -DHAVE_ERRMSG_H -DHAVE_MYSQLD_ERROR_H > -D_FILE_OFFSET_BITS=3D64 -I/usr/include/mysql -DBIG_JOINS=3D1 > -fno-strict-aliasing -DUNIV_LINUX -DUNIV_LINUX -fPIC -g -O2 -fPIC > -Wall -funroll-loops -c mysql2_ext.c > ./client.h:16:1: warning: =E2=80=98rb_thread_blocking_region=E2=80=99 def= ined but not > used [-Wunused-function] > gcc -I. -I. > -I/home/jim/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/i686-linux -I. > -DHAVE_MYSQL_H -DHAVE_ERRMSG_H -DHAVE_MYSQLD_ERROR_H > -D_FILE_OFFSET_BITS=3D64 -I/usr/include/mysql -DBIG_JOINS=3D1 > -fno-strict-aliasing -DUNIV_LINUX -DUNIV_LINUX -fPIC -g -O2 -fPIC > -Wall -funroll-loops -c client.c > client.c: In function =E2=80=98rb_mysql_client_info=E2=80=99: > client.c:539:3: warning: variable =E2=80=98wrapper=E2=80=99 set but not u= sed > [-Wunused-but-set-variable] > gcc -shared -o mysql2.so result.o mysql2_ext.o client.o -L. > -L/home/jim/.rvm/rubies/ruby-1.8.7-p334/lib > -Wl,-R/home/jim/.rvm/rubies/ruby-1.8.7-p334/lib -L. -rdynamic > -Wl,-export-dynamic -Wl,-rpath,/usr/lib/mysql -Wl,-R > -Wl,/home/jim/.rvm/rubies/ruby-1.8.7-p334/lib > -L/home/jim/.rvm/rubies/ruby-1.8.7-p334/lib -lruby > -Wl,-Bsymbolic-functions -rdynamic -L/usr/lib/mysql -lmysqlclient_r > -lrt -ldl -lcrypt -lm -lc > /usr/bin/ld: skipping incompatible > /home/jim/.rvm/rubies/ruby-1.8.7-p334/lib/libruby.so when searching for > -lruby > /usr/bin/ld: skipping incompatible > /home/jim/.rvm/rubies/ruby-1.8.7-p334/lib/libruby.so when searching for > -lruby > /usr/bin/ld: cannot find -lruby > collect2: ld returned 1 exit status > make: *** [mysql2.so] Error 1 > > > Gem files will remain installed in > /home/jim/.rvm/gems/ruby-1.8.7-p334@rails307/gems/mysql2-0.3.11 for > inspection. > Results logged to > /home/jim/.rvm/gems/ruby-1.8.7-p334@rails307 > /gems/mysql2-0.3.11/ext/mysql2/gem_make.out > > It just crashes out. > > Any ideas from that error? > Hi, I am unable to exactly reproduce your set-up because I do not (longer ?) see ruby ruby-1.8.7-p334 in the list on known rubies from rvm ... Would you have any problem with doing $ rvm get stable $ rvm install 1.8.7 and then trying again in that context ? In rvm that should not be a siginificant problem, since you could still keep you older version if you wished. That would make it easier for others to reproduce your set-up. I just tried with ruby-1.8.7-p330 on Ubuntu 10.04 in a fresh gemset and the `gem install mysql2` "just worked" ... HTH, Peter --20cf300fb11bad459d04b75ef322--