mysql:4192
From: e-oohira <e-oohira <e-oohira@xxxxxxxxxx>>
Date: Thu, 23 Aug 2001 19:17:57 +0900
Subject: [mysql 04192] Ruby から使えない
mysql-3.23.41を、Rubyから使おうとするとエラーが出ます。どなたかご
教授ください
-------------
補足
-------------
MySQLはSolaris8パッケージからインストールしたもの。
MySql自体は動いている。
原因は、どうも
libmysqlclient.soがないからのようですが、パッケージからインストー
ルしたためか、libmysqlclient.soがどこにもありません。
(libmysqlclient.a はある)
ソースコードからインストールしようとすると別の問題でインストール
できない。
-------------
経緯
-------------
MySQL導入後
Ruby-1.6.4をインストール -- うまくいった
mysql-ruby-2.3.2a.tar.gzを展開後以下
bash-2.03# pwd
/space/src/mysql-ruby-2.3.2a
bash-2.03# ruby extconf.rb
creating Makefile
bash-2.03# make
bash-2.03# ruby -I. test.rb sparc.kumage-h.ed.jp
test.rb:11:in `require': ld.so.1: ruby: 重大なエラー: 再配置エラ
ー: ファイル ./mysql.so: シンボル inet_addr: 参照シンボルが見つか
りません。 - ./mysql.so (LoadError)
from test.rb:11
--------------
以下は環境
--------------
MySQLは。/space/src/mysql-3.23.41-sun-solaris2.8-sparcへインスト
ールしています。
bash-2.03# uname -a
SunOS sparc 5.8 Generic_108528-06 sun4u sparc SUNW,Sun-Blade-100
bash-2.03# ls -la /lib/libc*
-rw-r--r-- 1 root 1749356 Jul 20 2000 /lib/libc.a
lrwxrwxrwx 1 root 11 Jan 23 2001 /lib/libc.so ->
./libc.so.1
-rwxr-xr-x 1 root 1135056 Jul 20 2000 /lib/libc.so.1
lrwxrwxrwx 1 root 14 Jan 23 2001 /lib/libc2.a ->
./libc2stubs.a
lrwxrwxrwx 1 root 17 Jan 23 2001 /lib/libc2.so ->
./libc2stubs.so.1
lrwxrwxrwx 1 root 17 Jan 23 2001 /lib/libc2.so.1 ->
./libc2stubs.so.1
-rw-r--r-- 1 root 27088 Jan 6 2000 /lib/libc2stubs.a
lrwxrwxrwx 1 root 17 Jan 23 2001 /lib/libc2stubs.so
-> ./libc2stubs.so.1
-rwxr-xr-x 1 root 22712 Jan 6 2000
/lib/libc2stubs.so.1
lrwxrwxrwx 1 root 16 Jan 23 2001 /lib/libcfgadm.so
-> ./libcfgadm.so.1
-rwxr-xr-x 1 root 34864 Jan 6 2000 /lib/libcfgadm.so.1
-rw-r--r-- 1 bin 104228 Dec 8 1999 /lib/libci.a
lrwxrwxrwx 1 root 12 Jan 23 2001 /lib/libci.so ->
./libci.so.1
-rwxr-xr-x 1 bin 86372 Dec 8 1999 /lib/libci.so.1
-rw-r--r-- 1 bin 37700 Dec 8 1999 /lib/libcics.a
lrwxrwxrwx 1 root 14 Jan 23 2001 /lib/libcics.so ->
./libcics.so.1
-rwxr-xr-x 1 bin 37080 Dec 8 1999 /lib/libcics.so.1
-rwxr-xr-x 1 bin 3928 Dec 2 1999 /lib/libcle.a
lrwxrwxrwx 1 root 11 Jan 23 2001 /lib/libcle.so ->
libcle.so.1
-rwxr-xr-x 1 bin 6000 Dec 2 1999 /lib/libcle.so.1
-rw-r--r-- 1 root 17284 Jan 6 2000 /lib/libcmd.a
lrwxrwxrwx 1 root 13 Jan 23 2001 /lib/libcmd.so ->
./libcmd.so.1
-rwxr-xr-x 1 root 24628 Jan 6 2000 /lib/libcmd.so.1
-rwxr-xr-x 1 bin 57644 Nov 4 1999 /lib/libconv.a
lrwxrwxrwx 1 root 13 Jan 23 2001 /lib/libcpc.so ->
./libcpc.so.1
-rwxr-xr-x 1 root 26972 Jan 6 2000 /lib/libcpc.so.1
-rwxr-xr-x 1 root 14268 Aug 3 2000 /lib/libcrle.so.1
lrwxrwxrwx 1 root 12 Jan 23 2001 /lib/libcrypt.a ->
libcrypt_i.a
lrwxrwxrwx 1 root 13 Jan 23 2001 /lib/libcrypt.so ->
libcrypt_i.so
lrwxrwxrwx 1 root 15 Jan 23 2001 /lib/libcrypt.so.1
-> libcrypt_i.so.1
-rw-r--r-- 1 root 12952 Jan 9 2000 /lib/libcrypt_i.a
lrwxrwxrwx 1 root 17 Jan 23 2001 /lib/libcrypt_i.so
-> ./libcrypt_i.so.1
-rwxr-xr-x 1 root 16020 Jan 9 2000
/lib/libcrypt_i.so.1
-rw-r--r-- 3 root 765864 Jan 6 2000 /lib/libcurses.a
lrwxrwxrwx 1 root 16 Jan 23 2001 /lib/libcurses.so
-> ./libcurses.so.1
-rwxr-xr-x 1 root 463544 Jan 6 2000 /lib/libcurses.so.1
bash-2.03# ls -la /lib/libpth*
lrwxrwxrwx 1 root 17 Jan 23 2001 /lib/libpthread.so
-> ./libpthread.so.1
-rwxr-xr-x 1 root 39364 Jan 6 2000
/lib/libpthread.so.1
bash-2.03# gcc -v
Reading specs from
/usr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.3/specs
gcc version 2.95.3 20010315 (release)
bash-2.03# gcc --version
2.95.3
bash-2.03# gcc -print-libgcc-file-name
/usr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.3/libgcc.a
bash-2.03# gcc -print-search-dirs
install: /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.3/
programs:
/usr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.3/:/usr/local/lib/gcc-lib/sparc-sun-solaris2.8/:/usr/lib/gcc/sparc-sun-solaris2.8/2.95.3/:/usr/lib/gcc/sparc-sun-solaris2.8/:/usr/local/sparc-sun-solaris2.8/bin/sparc-sun-solaris2.8/2.95.3/:/usr/local/sparc-sun-solaris2.8/bin/:/usr/ccs/bin/sparc-sun-solaris2.8/2.95.3/:/usr/ccs/bin/
libraries:
/usr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.3/:/usr/lib/gcc/sparc-sun-solaris2.8/2.95.3/:/usr/local/sparc-sun-solaris2.8/lib/sparc-sun-solaris2.8/2.95.3/:/usr/local/sparc-sun-solaris2.8/lib/:/usr/ccs/bin/sparc-sun-solaris2.8/2.95.3/:/usr/ccs/bin/:/usr/ccs/lib/sparc-sun-solaris2.8/2.95.3/:/usr/ccs/lib/:/usr/local/lib/sparc-sun-solaris2.8/2.95.3/:/usr/local/lib/:/lib/sparc-sun-solaris2.8/2.95.3/:/lib/:/usr/lib/sparc-sun-solaris2.8/2.95.3/:/usr/lib/
bash-2.03# perl -V
Summary of my perl5 (revision 5.0 version 6 subversion 1)
configuration:
Platform:
osname=solaris, osvers=2.8, archname=sun4-solaris
uname='sunos sparc 5.8 generic_108528-06 sun4u sparc
sunw,sun-blade-100 '
config_args='-ds -e'
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef
usemultiplicity=undef
useperlio=undef d_sfio=undef uselargefiles=define
usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
Compiler:
cc='gcc', ccflags ='-fno-strict-aliasing -I/usr/local/include
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
optimize='-O',
cppflags='-fno-strict-aliasing -I/usr/local/include'
ccversion='', gccversion='2.95.3 20010315 (release)',
gccosandvers='solaris2.8'
intsize=4, longsize=4, ptrsize=4, doublesize=8,
byteorder=4321
d_longlong=define, longlongsize=8, d_longdbl=define,
longdblsize=16
ivtype='long', ivsize=4, nvtype='double', nvsize=8,
Off_t='off_t', lseeksize=8
alignbytes=8, usemymalloc=y, prototype=define
Linker and Libraries:
ld='gcc', ldflags =' -L/usr/local/lib '
libpth=/usr/local/lib /usr/lib /usr/ccs/lib
libs=-lsocket -lnsl -ldl -lm -lc -liconv
perllibs=-lsocket -lnsl -ldl -lm -lc -liconv
libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
cccdlflags='-fPIC', lddlflags='-G -L/usr/local/lib'
Characteristics of this binary (from libperl):
Compile-time options: USE_LARGE_FILES
Built under solaris
Compiled at Aug 22 2001 01:25:31
@INC:
/usr/local/lib/perl5/5.6.1/sun4-solaris
/usr/local/lib/perl5/5.6.1
/usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris
/usr/local/lib/perl5/site_perl/5.6.1
/usr/local/lib/perl5/site_perl/5.6.0/sun4-solaris
/usr/local/lib/perl5/site_perl/5.6.0
/usr/local/lib/perl5/site_perl
.
bash-2.03# env | grep -i LIBRARY
LD_LIBRARY_PATH=/sol/bea/wl6/lib/solaris:/sol/bea/wl6/lib/solaris/oci816_8:/usr/local/lib
PATH=/usr/ccs/bin:/usr/ucb:/usr/local/bin:/sol/bea/wl6/bin:/space/bea/jdk130/jre/bin:/space/bea/jdk130/bin:/usr/sbin:/usr/bin:/usr/dt/bin:/usr/openwin/bin:/bin
bash-2.03# ldd /space/src/mysql-3.23.41
mysql-3.23.41-sun-solaris2.8-sparc
mysql-3.23.41-sun-solaris2.8-sparc.tar mysql-3.23.41.tar.gz
bash-2.03# ldd
/space/src/mysql-3.23.41-sun-solaris2.8-sparc/bin/mysql
libcurses.so.1 => /usr/lib/libcurses.so.1
libz.so.1 => /usr/lib/libz.so.1
libcrypt_i.so.1 => /usr/lib/libcrypt_i.so.1
libgen.so.1 => /usr/lib/libgen.so.1
libsocket.so.1 => /usr/lib/libsocket.so.1
libnsl.so.1 => /usr/lib/libnsl.so.1
libm.so.1 => /usr/lib/libm.so.1
libc.so.1 => /usr/lib/libc.so.1
libdl.so.1 => /usr/lib/libdl.so.1
libmp.so.2 => /usr/lib/libmp.so.2
/usr/platform/SUNW,Sun-Blade-100/lib/libc_psr.so.1
なお、(別の問題として)ソースからMySQLをコンパイルしようとする
と、
configure時にエラーをはきます。
bash-2.03# ./configure --prefix=/usr/local/mysql
--localstatedir=/usr/local/mysqldata \
> --with-charset=ujis
loading cache ./config.cache
checking host system type... sparc-sun-solaris2.8
checking target system type... sparc-sun-solaris2.8
checking build system type... sparc-sun-solaris2.8
checking for a BSD compatible install... ./install-sh -c
checking whether build environment is sane... yes
checking whether make sets ${MAKE}... (cached) yes
checking for working aclocal... missing
checking for working autoconf... missing
checking for working automake... missing
checking for working autoheader... missing
checking for working makeinfo... missing
checking whether to enable maintainer-specific portions of
Makefiles... no
checking whether build environment is sane... yes
checking whether make sets ${MAKE}... (cached) yes
checking for gawk... (cached) nawk
checking for gcc... (cached) gcc
checking whether the C compiler (gcc ) works... yes
checking whether the C compiler (gcc ) is a cross-compiler...
no
checking whether we are using GNU C... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for c++... (cached) c++
checking whether the C++ compiler (c++ ) works... yes
checking whether the C++ compiler (c++ ) is a cross-compiler...
yes
checking whether we are using GNU C++... (cached) yes
checking whether c++ accepts -g... (cached) yes
checking how to run the C preprocessor... (cached) gcc -E
checking for ranlib... (cached) ranlib
checking for ld used by GCC... (cached) /usr/ccs/bin/ld
checking if the linker (/usr/ccs/bin/ld) is GNU ld... (cached) no
checking for BSD-compatible nm... (cached) /usr/ccs/bin/nm -p
checking whether ln -s works... (cached) yes
loading cache ./config.cache within ltconfig
checking for object suffix... o
checking for executable suffix... (cached) no
checking for gcc option to produce PIC... -fPIC
checking if gcc PIC flag -fPIC works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.lo... yes
checking if gcc supports -fno-rtti -fno-exceptions ... yes
checking if gcc static flag -static works... -static
checking if the linker (/usr/ccs/bin/ld) is GNU ld... no
checking whether the linker (/usr/ccs/bin/ld) supports shared
libraries... yes
checking command to parse /usr/ccs/bin/nm -p output... ok
checking how to hardcode library paths into programs... immediate
checking for /usr/ccs/bin/ld option to reload object files... -r
checking dynamic linker characteristics... solaris2.8 ld.so
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for objdir... .libs
creating libtool
loading cache ./config.cache
checking for a BSD compatible install... ./install-sh -c
checking for bison... bison -y
checking for pdftex... no
checking return type of sprintf... configure: error: can not run
test program while cross compiling
-> 4192 2001-08-23 19:17 [e-oohira <e-oohira@x] Ruby から使えない 4198 2001-08-24 12:19 ┣[<makikuchi@xxxxxxxxx] 4199 2001-08-24 12:36 ┣[Hiroki TANIKAWA <hir] 4202 2001-08-25 18:06 ┗[とみたまさひろ <tomm]