From: David D'Andrea Date: 2003-06-25T02:22:27+09:00 Subject: Re: Newbie dbi install problem On Tuesday, June 24, 2003, at 12:04 PM, Paul DuBois wrote: > At 17:39 +0900 6/24/03, David D'Andrea wrote: >> Appreciate the pointer, pretty ug primitive mistake there. >> >> However I still can't get this to work. I think the mysql DBD isn't >> getting installed properly. >> >> [~/Desktop/mysql-ruby-2.4.4a]% ruby extconf.rb >> --with-mysql-include=/usr/local/mysql/include >> --with-mysql-lib=/usr/local/mysql/lib >> checking for mysql_query() in -lmysqlclient... no >> checking for main() in -lm... yes >> checking for mysql_query() in -lmysqlclient... no >> checking for main() in -lz... yes >> checking for mysql_query() in -lmysqlclient... yes >> checking for mysql.h... yes >> creating Makefile >> % make >> gcc -fno-common -g -O2 -fno-common -pipe -no-cpp-precomp -I. >> -I/sw/lib/ruby/1.6/powerpc-darwin6.6 -I. -I/sw/include -DHAVE_MYSQL_H >> -I/sw/include -I/usr/local/mysql/include -c -o mysql.o mysql.c >> mysql.c: In function `Init_mysql': >> mysql.c:1420: `ER_SUBSELECT_NO_' undeclared (first use in this >> function) >> mysql.c:1420: (Each undeclared identifier is reported only once >> mysql.c:1420: for each function it appears in.) >> make: *** [mysql.o] Error 1 >> % ruby -I. ./test.rb localhost root lovelypass >> ./test.rb:11:in `require': No such file to load -- ./mysql (LoadError) >> from ./test.rb:11 >> '%make install' here fails too, and running simple.rb still returns >> the same error (undefined method, DBI::InterfaceError) > > Hmm, that's weird. Looks like the configuration process (which > configures > mysql.c) doesn't look for digits in the error constant names. Try this > patch and let us know what happens: > > --- extconf.rb.orig Sat Feb 22 20:20:50 2003 > +++ extconf.rb Tue Jun 24 11:02:53 2003 > @@ -44,7 +44,7 @@ > next unless l =~ /errmsg\.h|mysqld_error\.h/ > fn = l.split(/\"/)[1] > IO::foreach(fn) do |m| > - if m =~ /^#define\s+([CE]R_[A-Z_]+)/ then > + if m =~ /^#define\s+([CE]R_[A-Z0-9_]+)/ then > error_syms << $1 > end > end > > If that works for you (it does for me), I'll send the patch to Tomita. Thank you for the patch. It seems to help, make now gets further but fails on the link... (What file is it looking for? Maybe I need to set some PATH variable??) (extconf.rb and test.rb before & after make produce the same output as above) % make gcc -fno-common -g -O2 -fno-common -pipe -no-cpp-precomp -I. -I/sw/lib/ruby/1.6/powerpc-darwin6.6 -I. -I/sw/include -DHAVE_MYSQL_H -I/sw/include -I/usr/local/mysql/include -c -o mysql.o mysql.c cc -dynamic -bundle -undefined suppress -flat_namespace -L/usr/local/mysql/lib -L/sw/lib -o mysql.bundle mysql.o -L. -lruby -lmysqlclient -lz -lm ld: can't locate file for: -lruby make: *** [mysql.bundle] Error 1 David