# On ubuntu, ruby can't find the gems

**URL:** <https://www.ruby-forum.com/t/on-ubuntu-ruby-cant-find-the-gems/146042>\
**Category:** Ruby\
**Created:** [August 16, 2008, 4:23pm UTC](https://www.ruby-forum.com/t/on-ubuntu-ruby-cant-find-the-gems/146042 "2008-08-16T16:23:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pezdude](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a87d85/32.png) [@pezdude](https://www.ruby-forum.com/u/pezdude)\
**Post date:** [August 16, 2008, 4:23pm UTC](https://www.ruby-forum.com/t/on-ubuntu-ruby-cant-find-the-gems/146042/1 "2008-08-16T16:23:47Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![pezdude](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a87d85/32.png) [@pezdude](https://www.ruby-forum.com/u/pezdude)\
**Post date:** [August 16, 2008, 4:36pm UTC](https://www.ruby-forum.com/t/on-ubuntu-ruby-cant-find-the-gems/146042/2 "2008-08-16T16:36:42Z")

</div>

require ‘rubygems’

> require ‘image\_science’

?

---

<div class="post-metadata">

**Author:** ![pezdude](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a87d85/32.png) [@pezdude](https://www.ruby-forum.com/u/pezdude)\
**Post date:** [August 16, 2008, 4:49pm UTC](https://www.ruby-forum.com/t/on-ubuntu-ruby-cant-find-the-gems/146042/3 "2008-08-16T16:49:22Z")

</div>

Phlip wrote:

> require ‘rubygems’
> 
> > require ‘image\_science’
> 
> ?

“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.

---

<div class="post-metadata">

**Author:** ![pezdude](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a87d85/32.png) [@pezdude](https://www.ruby-forum.com/u/pezdude)\
**Post date:** [August 16, 2008, 7:48pm UTC](https://www.ruby-forum.com/t/on-ubuntu-ruby-cant-find-the-gems/146042/4 "2008-08-16T19:48:46Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![pezdude](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a87d85/32.png) [@pezdude](https://www.ruby-forum.com/u/pezdude)\
**Post date:** [August 17, 2008, 5:21am UTC](https://www.ruby-forum.com/t/on-ubuntu-ruby-cant-find-the-gems/146042/5 "2008-08-17T05:21:37Z")

</div>

Serabe wrote:

> 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.
