ruby gem install mysql compile error

A

Aj Mccauley

I am having an issue installing the mysql gem on my fedora 11 ruby
1.9.1p376 installation.

mysql is installed and working. When I try to run sudo gem install mysql
I get the following message:

Building native extensions. This could take a while...
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.

/usr/local/bin/ruby19 extconf.rb
checking for mysql_ssl_set()... yes
checking for rb_str_set_len()... yes
checking for rb_thread_start_timer()... no
checking for mysql.h... yes
creating Makefile

make
gcc -I. -I/usr/local/include/ruby19-1.9.1/x86_64-linux
-I/usr/local/include/ruby19-1.9.1/ruby/backward
-I/usr/local/include/ruby19-1.9.1 -I. -DHAVE_MYSQL_SSL_SET
-DHAVE_RB_STR_SET_LEN -DHAVE_MYSQL_H -I/usr/local -I/usr/include/mysql
-g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
--param=ssp-buffer-size=4 -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64
-D_LARGEFILE_SOURCE -fno-strict-aliasing -fwrapv -fPIC -DUNIV_LINUX
-fPIC -O2 -g -Wall -Wno-parentheses -o mysql.o -c mysql.c
gcc -shared -o mysql_api.so mysql.o -L. -L/usr/local/lib
-Wl,-R/usr/local/lib -L. -L/usr/local -rdynamic -Wl,-export-dynamic
-rdynamic -L/usr/lib64/mysql -lmysqlclient -lz -lcrypt -lnsl -lm -lssl
-lcrypto -lpthread -lrt -ldl -lcrypt -lm -lc
/usr/bin/ld: /usr/local/lib/libssl.a(t1_srvr.o): relocation R_X86_64_32
against `.data' can not be used when making a shared object; recompile
with -fPIC
/usr/local/lib/libssl.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [mysql_api.so] Error 1


Gem files will remain installed in
/usr/local/lib/ruby19/gems/1.9.1/gems/mysql-2.8.1 for inspection.
Results logged to
/usr/local/lib/ruby19/gems/1.9.1/gems/mysql-2.8.1/ext/mysql_api/gem_make.out


I am not sure what I am doing wrong here any ideas would be appreciated.
I tried downloading the source and get the same error when I enter make.
 
L

Luis Lavena

I am having an issue installing the mysql gem on my fedora 11 ruby
1.9.1p376 installation.

mysql is installed and working. When I try to run sudo gem install mysql
I get the following message:

Building native extensions.  This could take a while...
ERROR:  Error installing mysql:
 ERROR: Failed to build gem native extension.

/usr/local/bin/ruby19 extconf.rb
checking for mysql_ssl_set()... yes
checking for rb_str_set_len()... yes
checking for rb_thread_start_timer()... no
checking for mysql.h... yes
creating Makefile

make
gcc -I. -I/usr/local/include/ruby19-1.9.1/x86_64-linux
-I/usr/local/include/ruby19-1.9.1/ruby/backward
-I/usr/local/include/ruby19-1.9.1 -I. -DHAVE_MYSQL_SSL_SET
-DHAVE_RB_STR_SET_LEN -DHAVE_MYSQL_H -I/usr/local   -I/usr/include/mysql
-g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
--param=ssp-buffer-size=4 -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64
-D_LARGEFILE_SOURCE -fno-strict-aliasing -fwrapv -fPIC   -DUNIV_LINUX
-fPIC  -O2 -g -Wall -Wno-parentheses  -o mysql.o -c mysql.c
gcc -shared -o mysql_api.so mysql.o -L. -L/usr/local/lib
-Wl,-R/usr/local/lib -L. -L/usr/local -rdynamic -Wl,-export-dynamic
-rdynamic -L/usr/lib64/mysql -lmysqlclient -lz -lcrypt -lnsl -lm -lssl
-lcrypto  -lpthread -lrt -ldl -lcrypt -lm   -lc
/usr/bin/ld: /usr/local/lib/libssl.a(t1_srvr.o): relocation R_X86_64_32
against `.data' can not be used when making a shared object; recompile
with -fPIC
/usr/local/lib/libssl.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [mysql_api.so] Error 1

Gem files will remain installed in
/usr/local/lib/ruby19/gems/1.9.1/gems/mysql-2.8.1 for inspection.
Results logged to
/usr/local/lib/ruby19/gems/1.9.1/gems/mysql-2.8.1/ext/mysql_api/gem_make.ou t

I am not sure what I am doing wrong here any ideas would be appreciated.
I tried downloading the source and get the same error when I enter make.

Reading the error once again:

/usr/bin/ld: /usr/local/lib/libssl.a(t1_srvr.o): relocation
R_X86_64_32
against `.data' can not be used when making a shared object;
recompile
with -fPIC
/usr/local/lib/libssl.a: could not read symbols: Bad value

Seems clear to me: there is an issue with libssl (OpenSSL) installed
in your system.

I cannot provide more help because I'm not familiarized with Fedora,
but looks like like the library is not prepared to link with Ruby 1.9,
and is mentioning recompilation with -fPIC option.

Anyone encountered similar issue?
 
B

brabuhr

I am having an issue installing the mysql gem on my fedora 11 ruby
1.9.1p376 installation.

mysql is installed and working. When I try to run sudo gem install mysql
I get the following message:

/usr/bin/ld: /usr/local/lib/libssl.a(t1_srvr.o): relocation R_X86_64_32
against `.data' can not be used when making a shared object; recompile
with -fPIC
/usr/local/lib/libssl.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [mysql_api.so] Error 1

/usr/local/lib/libssl.a
You built your own openssl rather than using the Fedora packages?
 
A

AJ McCauley

You built your own openssl rather than using the Fedora packages?

I did build openssl-0.9.8l from source. In hind sight, it would have
been a better idea to just use yum...
 
A

AJ McCauley

You built your own openssl rather than using the Fedora packages?
I did build openssl-0.9.8l from source. In hind sight, it would have
been a better idea to just use yum...

I just rebuilt the server and used the Fedora packaged openssl and it
seems to be working fine! Thanks for the help in pointing me in the
right direction.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top