I’m not certain if this is a case of the blind leading the blind
because my knowledge of ruby and libraries is equally limited but I had
a similar problem with mysql-ruby when I first started using it.
However for me,
$echo “puts ‘test’” | ruby -w -r mysql.so
test
$
works. But my original problem was similar…when I first installed and
compiled mysql-ruby, the test cases ran fine (test.rb running in the
mysql-ruby directory). Later, I had to scrap the directory and untar it
anew. Then test.rb stopped working:
$ruby test.rb localhost stephyn 0m4hhung
test.rb:11:in `require’: No such file to load – ./mysql (LoadError)
from test.rb:11
$
I inferred that the error “./mysql” meant ruby was looking for it in
the current directory by default or design, I hadn’t rebuilt mysql-ruby
so the file naturally wasn’t there and sure enough the line in test.rb
is:
require “./mysql.o”
So in that case, it was looking for it in the current directory by
design.
If you can still run test.rb from the directory where you built
mysql-ruby (probably mysql-ruby-{version #}, then perhaps the install
process failed without your knowledge or the library was not put where
it is expected (I have had this problem with some packages after
compiling them on OS X).
My equivalent of mysql.so is in:
/usr/local/lib/ruby/1.6/powerpc-darwin6.6/
it is also the directory where just about every other binary is
located. (libruby.a, socket.bundle—I guess socket.so or socket.o for
peeps on other platforms).
I would recommend searching for libruby.a and nosing around to see what
else is in there and adjoining directories.
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.
My $0.02…maybe not even that.
Steve
(And I thought I wasn’t going to have to learn C!)
···
On Saturday, July 12, 2003, at 11:43 AM, Eric Anderson wrote:
As Brian Candler pointed out, what I posted is not what I meant to
post. Somehow I got my switches confused. I was trying to isolate the
script down to the smallest possible to show my problem, but got the
-l and -r switch confused ( as well as the -v and -w ). That’s what I
get for programming on a Friday night.
Anway, let me try again. By running the following:
echo “puts ‘test’” | ruby -w -r mysql.so
on my new ruby-mysql library I get the following:
0: (null) - ./mysql.so (LoadError)
Is there anyway I can get more debugging information. It looks like it
is throwning some kind of load error exception. Is there anyway I can
get a message associated with that error so that I can debug why the
library is not loading?
Thanks for any information, and sorry about the last confusing post.
–
Eric Anderson