[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: ruby-mysql library load error

eric.anderson

7/16/2003 3:59:00 AM

Stephyn Butcher <tendzin.dorje@starpower.net> wrote in message news:<8BACDF74-B488-11D7-B1F0-000393A478C8@starpower.net>...
> If you *can't* still run test.rb from the compilation directory, I
> would start over until you can...that would limit the problem search
> space.

Thanks for trying to help, but I don't think this is the same problem.
It finds the library, but can't load it. Let me start from scratch:

%> ruby extconf.rb --with-mysql-include=/usr/include/mysql/
--with-mysql-lib=/usr/lib/mysql/

checking for mysql_query() in -lmysqlclient... yes
checking for mysql.h... yes
creating Makefile
cpp0: warning: changing search order for system directory
"/usr/include"
cpp0: warning: as it has already been specified as a non-system
directory

%> make
gcc -shared -L/usr/lib/mysql/ -L/usr/lib/ruby/1.6/i386-linux
-L/usr/lib -o mysql.so -L. -lruby -lmysqlclient -lc

%> echo "puts 'test'" | ruby -w -r ./mysql.so
0: (null) - ./mysql.so (LoadError)

I just had a thought after writing this. I did a locate on mysql.so
and I noticed that the following file exists:
/usr/lib/php4/mysql.so

Could it be trying to load that even though I am specifying
"./mysql.so". How do I change the dynamic library search path?
1 Answer

Brian Candler

7/16/2003 7:59:00 AM

0

On Wed, Jul 16, 2003 at 01:04:05PM +0900, Eric Anderson wrote:
> %> echo "puts ''test''" | ruby -w -r ./mysql.so
> 0: (null) - ./mysql.so (LoadError)
>
> I just had a thought after writing this. I did a locate on mysql.so
> and I noticed that the following file exists:
> /usr/lib/php4/mysql.so
>
> Could it be trying to load that even though I am specifying
> "./mysql.so". How do I change the dynamic library search path?

ruby -r /path/to/the/correct/mysql.so

or change $: - but I don''t think that''s the problem as you explicitly gave
"./" as the path.

You could try strace/truss/ktrace (depending on your OS) on ruby:

strace ruby -r ./mysql.so

which should show you what files it''s trying to access.

Regards,

Brian.