mysql-ruby on cygwin

S

Steven Jenkins

As the subject says.

Windows 2000 Professional Ver 5.0 Build 2195 Service Pack 4
Cygwin DLL version 1.5.5

First of all, Ruby works:

$ ruby -v
ruby 1.8.0 (2003-08-04) [i386-cygwin]

And the mysql client works:

$ mysql --password=********
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 270 to server version: 4.0.14

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>

And I have mysql-ruby installed:

$ ruby -e 'p $:'
["/usr/lib/ruby/site_ruby/1.8",
"/usr/lib/ruby/site_ruby/1.8/i386-cygwin", "/usr/lib/ruby/site_ruby",
"/usr/lib/ruby/1.8", "/usr/lib/ruby/1.8/i386-cygwin", "."]

$ ls -l /usr/lib/ruby/site_ruby/1.8/i386-cygwin
total 107
-r-xr-xr-x 1 sjenkins mkgroup_ 109568 Nov 6 13:39 mysql.so

But when I try to load it, I get this:

$ irb
irb(main):001:0> require 'mysql'
LoadError: dlopen: Win32 error 126 -
/usr/lib/ruby/site_ruby/1.8/i386-cygwin/mysql.so
from /usr/lib/ruby/site_ruby/1.8/i386-cygwin/mysql.so
from (irb):1
irb(main):002:0>

From what I read on the web, error 126 is often caused by attempting to
load a library that depends on other libraries that can't be found.
Snooping a little:

$ strings mysql.so|grep dll
cygwin-ruby16.dll
cygwin1.dll

The closest thing I have to cygwin-ruby16.dll is /usr/bin/cygruby18.dll.
So I figure I'll just recompile mysql-ruby from source. The mysql
libraries are here:

$ ls /cygdrive/c/mysql/lib/opt
libmySQL.a@ libmySQL.lib mysys-max.lib regex.lib zlib.lib
libmySQL.dll mysqlclient.lib mysys.lib strings.lib

So I try this:

$ ruby extconf.rb --with-mysql-lib=/cygdrive/c/mysql/lib/opt
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

I'm out of ideas. Any suggestions?

Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,233
Latest member
AlyssaCrai

Latest Threads

Top