debian ruby libraries

Z

Zach Dennis

I've got a few directories with ruby libraries.

/usr/lib/ruby/1.8
/usr/local/lib/ruby/1.8

I am on a debian package and I installed "apt-get install libmysql-ruby1.8".
It installed the mysql.so file into the /usr/lib/ruby/1.8/i386-linux/
directory. When I run irb or ruby it doesn't appear to be looking there.
Instead it looks in the /usr/local/lib/ruby/1.8 directory. Any quick and
easy change to get ruby to look in the proper directory or to tell debian to
install to the proper directory? Thanks,

Zach
 
E

Eric Schwartz

Zach Dennis said:
I've got a few directories with ruby libraries.

/usr/lib/ruby/1.8
/usr/local/lib/ruby/1.8

I am on a debian package and I installed "apt-get install libmysql-ruby1.8".
It installed the mysql.so file into the /usr/lib/ruby/1.8/i386-linux/
directory. When I run irb or ruby it doesn't appear to be looking there.

What version of ruby are you running?

$ locate mysql.so
/usr/lib/ruby/1.6/ia64-linux/mysql.so
/usr/lib/ruby/1.8/ia64-linux/mysql.so

$ dpkg -l irb ruby1.8
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name Version Description
+++-==============-==============-============================================
ii irb 1.8.1-7 Interactive Ruby (irb)
ii ruby1.8 1.8.1-8 Interpreter of object-oriented scripting lan

$ irb
irb(main):001:0> require 'mysql'
=> true
irb(main):002:0> puts $:.join(', ')
/usr/local/lib/site_ruby/1.8, /usr/local/lib/site_ruby/1.8/ia64-linux, /usr/local/lib/site_ruby, /usr/lib/ruby/1.8, /usr/lib/ruby/1.8/ia64-linux, .
=> nil
Instead it looks in the /usr/local/lib/ruby/1.8 directory.

Do you have mysql.so there? Do you have $RUBYLIB set to look there
before the predefined paths? Are you explicitly setting $: in your
scripts? Those are the only things I can think of that could cause
this, since /usr/local/lib/ruby/1.8 is not in $: by default in
ruby1.8.
Any quick and easy change to get ruby to look in the proper
directory or to tell debian to install to the proper directory?

Debian is installing it in the proper directory; why you're not
looking there is a good question, though.

-=Eric
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top