From: Joseph Erickson Date: 2002-07-17T11:47:17+09:00 Subject: Re: install ruby-mysql in OS X, part 2 When it says that it's searching for -lmysqlclient, it is looking for the libmysqlclient.a file in your lib folder. /usr/local/mysql/lib/mysql? I've never seen that one but I'll take your word for it. Mine, which I got from http://www.entropy.ch/software/MacOSx/mysql/, puts all of these files in /usr/local/mysql/lib/ without the mysql on the end. But from what your telling me, your install should work. I assume you installed from source heh? I just reinstalled from source and I have a break through. I get the same errors you are: [localhost:~/Desktop/mysql-ruby-2.4.2a] erickson% ruby extconf.rb --with-mysql-lib=/usr/local/mysql/lib/mysql --with-mysql- include=/usr/local/mysql/include/mysql/ 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... no checking for main() in -lsocket... no checking for mysql_query() in -lmysqlclient... no checking for main() in -lnsl... no checking for mysql_query() in -lmysqlclient... no But If I install from that site above(entropy), it all works fine. The version on that site is 3.23.51. The rason seems to be because the entropy install puts the files in /usr/local/mysql/lib and /usr/local/mysql/include. A work around that should work for now( at least for me) is to soft link the files up one directory. Just run: sudo ln -s /usr/local/mysql/lib/mysql/libmysqlclient.a /usr/local/mysql/lib/ sudo ln -s /usr/local/mysql/include/mysql/mysql.h /usr/local/mysql/include/ and then run: ruby extconf.rb --with-mysql-dir=/usr/local/mysql It seems to me that (and please don't flame me on this) mkmf has problems when a path has two directory names the same, like /usr/local/mysql/lib/mysql (the two mysqls). In the mkmf.log I see: cc -o conftest -I/usr/local/lib/ruby/1.6/powerpc-darwin5.1 -g -O2 -pipe -no-precomp -I/usr/local/include -I/usr/local/include -L/usr/local/lib -L/usr/local/lib/mysql conftest.c -lmysqlclient -lz -lm -lobjc /usr/bin/ld: warning -L: directory name (/usr/local/lib/mysql) does not exist /usr/bin/ld: can't locate file for: -lmysqlclient After I run: ruby extconf.rb --with-mysql-lib=/usr/local/mysql/lib/mysql/ --with-mysql-include=/usr/local/mysql/include/mysql/ Something to look into? I tried but I didn't see anything wrong really. If no one else has seen this, it could just be an 'us' problem and I can live with that. Joseph Erickson On Tuesday, July 16, 2002, at 08:38 PM, GARY PALMER wrote: > Joseph, > > The locations may seem odd, but they were created by the secure > installation process recommended at > . I followed > those procedures to the letter. > > libmysqlclient.a is in /usr/local/mysql/lib/mysql/ > mysql.h is in /usr/local/mysql/include/mysql/ > extconf.rb is in ~/Apps/mysql-ruby-2.4.2 > > The results of the attempted configuration following your > recommendations (I think) were the same as before: > > [localhost:~/Apps/mysql-ruby-2.4.2] gary% ruby extconf.rb > --with-mysql-lib=/usr/local/mysql/lib/mysql --with-mysql- > include=/usr/local/mysql/include/mysql/ > checking for mysql_query() in -lmysqlclient... no > > The result was the same in root#. > > Is it telling me that it doesn't find libmysqlclient.a or that the > former doesn't have mysql_query() for some reason? > > Verification of locations: > > [localhost:~/Apps/mysql-ruby-2.4.2] gary% cd /usr/local/mysql/lib/mysql/ > [localhost:mysql/lib/mysql] gary% ls > libdbug.a libmerge.a libmyisammrg.a > libmysqlclient.la libmysys.a > libheap.a libmyisam.a libmysqlclient.a > libmystrings.a libnisam.a > [localhost:mysql/lib/mysql] gary% > > [localhost:mysql/lib/mysql] gary% cd /usr/local/mysql/include/mysql/ > [localhost:mysql/include/mysql] gary% ls > chardefs.h keymaps.h my_global.h > my_pthread.h mysql_version.h sslopt-case.h tilde.h > dbug.h m_ctype.h my_list.h > my_sys.h mysqld_error.h sslopt-longopts.h > errmsg.h m_string.h my_net.h > mysql.h raid.h sslopt-usage.h > history.h my_config.h my_no_pthread.h > mysql_com.h readline.h sslopt-vars.h > > [localhost:mysql/include/mysql] gary% cd ~/Apps/mysql-ruby-2.4.2 > [localhost:~/Apps/mysql-ruby-2.4.2] gary% ls > MANIFEST README.ja > extconf.rb mysql-compat.rb > mysql.c test.rb > README depend > extconf.rb.bak mysql-ruby-2.4.2.tar.gz t > > > > Gary B. Palmer > ANT & ETS > University of Nevada > Las Vegas, NV > 89154 > gbp@nevada.edu > anthro-ets.unlv.edu > >