From: Paul DuBois Date: 2003-06-25T01:04:49+09:00 Subject: Re: Newbie dbi install problem 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. > >hrmm...? > >I believe I have the include & lib parameters to extconf.rb >correctly set... Running extconf.rb with no args, or as suggested >in DuBois' tutorial also fail (they don't find the mysql_query()) >I'm not sure what to try at this point, I've taken a few stabs: >It doesn't make a difference if I reinstall the DBI after this DBD install. >I've also tried stopping mysqld before installing the DBD, and >installing under bash, no difference. >I've even tried editing extconf.rb's Makefile to fill in an empty >LIBPATH param... > >any ideas? I hope I'm not missing something obvious again... > >David > >On Monday, June 23, 2003, at 02:55 PM, Brian Candler wrote: >>You need to install the ruby-mysql package, *as well as* the ruby-dbi >>package. (ruby-dbi is just a wrapper around ruby-dbi, which is in turn a >>Ruby wrapper around the native C API)