on ubuntu, ruby can't find the gems

D

Dave Cottingham

I'm working on Ubuntu 7.10, which presumably does things the Debian way.
I have loaded several gems without apparent problem, and I see them
sitting there in /var/lib/gems/1.8, which I understand is the Debian
place for them. But when I try to use one of them in ruby, e.g. if I
say

require 'image_science'

it says

-:1:in `require': no such file to load -- image_science (LoadError)
from -:1

So ruby apparently doesn't know to look for them there. I've tried
defining RUBYLIB to '/var/lib/gems/1.8' or '/var/lib/gems/1.8/gems' or
/var/lib/gems' with no improvement.

So my question is, how is ruby supposed to find the gems?

BTW I got ruby and gem by apt-get, so it's a little surprising that they
aren't configured to play with each other.
 
D

Dave Cottingham

Phlip said:
require 'rubygems'


?

"require 'rubygems'" works; rubygems of course was not installed by gem,
and it's in the main ruby library, which on my machine is in
/usr/lib/ruby/1.8.

The stuff my ruby can't find are the packages that were installed by
gem.
 
S

Serabe

I think that what Phlip really meant is that you should require
rubygems before requiring a gem. Example:

require 'rubygems'
require 'image_science'

Cheers,

Serabe
 
D

Dave Cottingham

Serabe said:
I think that what Phlip really meant is that you should require
rubygems before requiring a gem. Example:

require 'rubygems'
require 'image_science'

Cheers,

Serabe

Ahh. Sorry I was being thickheaded. Yes, that solves the problem.

Thanks for the help.
 

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,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top