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?

<Hours pass>

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 <http://developer.apple.com/internet/macosx/osdb.html>. 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

Joseph,

That all makes a lot of sense to me. I will give it a try tomorrow
morning and let you know the outcome. I have a similarly excruciating
process going on with cpan and perl dbi, dbd stuff, and I didn’t change
any pathways in perl! All I need it for is to run the mysql tests.

Gary

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

Joseph,

The locations may seem odd, but they were created by the secure
installation process recommended at
http://developer.apple.com/internet/macosx/osdb.html. 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

···

On Tuesday, July 16, 2002, at 07:47 PM, Joseph Erickson wrote:

On Tuesday, July 16, 2002, at 08:38 PM, GARY PALMER wrote:

extconf.rb still can’t find libmysqlclient.a. Here is the story. I am
wondering if it is time to start over with a remake of mysql, but if
that requires me to undo what I did in the original installation, I’m
afraid I will just make things worse.

Creation of links:

[localhost:local/mysql/lib] root# ls -l
total 8
lrwxr-xr-x 1 root mysql 43 Jul 17 08:53 libmysqlclient.a ->
/usr/local/mysql/lib/mysql/libmysqlclient.a
drwxr-xr-x 12 root mysql 364 Jul 11 19:34 mysql

[localhost:local/mysql/include] root# ls -l
total 8
drwxr-xr-x 27 root mysql 874 Jul 11 19:33 mysql
lrwxr-xr-x 1 root mysql 38 Jul 17 08:53 mysql.h ->
/usr/local/mysql/include/mysql/mysql.h

Verification of locations:

[localhost:local/mysql/include] root# ls -l
/usr/local/mysql/lib/mysql/ | grep libmysqlclient.a
-rw-r–r-- 1 root mysql 1799928 Jul 11 19:33 libmysqlclient.a
[localhost:local/mysql/include] root# ls -l
/usr/local/mysql/include/mysql/ | grep mysql.h
-rw-r–r-- 1 root mysql 10787 Jul 11 19:33 mysql.h

Run extconf.rb:

[localhost:gary/apps/mysql-ruby-2.4.2] root# ruby extconf.rb
–with-mysql-dir=/usr/local/mysql
checking for mysql_query() in -lmysqlclient… no

So I tried adding lib/

[localhost:gary/apps/mysql-ruby-2.4.2] root# ruby extconf.rb
–with-mysql-dir=/usr/local/mysql/lib
checking for mysql_query() in -lmysqlclient… no

I find no copy of mkmf.log:

[localhost:gary/apps/mysql-ruby-2.4.2] root# 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
[localhost:gary/apps/mysql-ruby-2.4.2] root# find / -name mkmf.log -print
[localhost:gary/apps/mysql-ruby-2.4.2] root#

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

Joseph,

The locations may seem odd, but they were created by the secure
installation process recommended at
http://developer.apple.com/internet/macosx/osdb.html. 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

···

On Tuesday, July 16, 2002, at 07:47 PM, Joseph Erickson wrote:

On Tuesday, July 16, 2002, at 08:38 PM, GARY PALMER wrote: