# Using gems problem -- LoadError

**URL:** <https://rubytalk.org/t/using-gems-problem-loaderror/26604>\
**Category:** ruby-talk\
**Created:** [12 April 2006 15:01 UTC](https://rubytalk.org/t/using-gems-problem-loaderror/26604 "2006-04-12T15:01:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vladsialv\_Tchernev](https://avatars.discourse-cdn.com/v4/letter/v/a8b319/32.png) [@Vladsialv\_Tchernev](https://rubytalk.org/u/Vladsialv_Tchernev)\
**Post date:** [12 April 2006 15:01 UTC](https://rubytalk.org/t/using-gems-problem-loaderror/26604/1 "2006-04-12T15:01:53Z")

</div>

Hello all,  
I am a newbie with ruby and gems and I have this frustrating problem not being  
able to load any gem I install. I am running Ubuntu 5.10 and I have just  
installed ruby1.8 deb (1.8.4) and have compiled rubygems-0.8.11 without any  
problem. I am able to load rubygems (require 'rubygems') and I setup RUBYOPT  
var as advised in gems doc (export RUBYOPT=rubygems). However, when I try to  
load a gem ($ruby1.8 -e "require 'some\_gem' ") I always get an error (This is  
for xml-simple gem:

/usr/local/lib/site\_ruby/1.8/rubygems/custom\_require.rb:21:in `require\_\_': no  
such file to load -- xml-simple (LoadError)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from /usr/local/lib/site\_ruby/1.8/rubygems/custom\_require.rb:21:in  
`require'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from -e:1

I checked and it seems that rubygems creates a dir-y for every installed gem  
in /usr/lib/ruby/gems/1.8/gems/, but this dir-y is not in the load path:  
$ ruby1.8 -e "p $:"  
["/usr/local/lib/site\_ruby/1.8", "/usr/local/lib/site\_ruby/1.8/i486-linux",  
"/usr/local/lib/site\_ruby/1.8/i386-linux", "/usr/local/lib/site\_ruby",  
"/usr/lib/ruby/1.8", "/usr/lib/ruby/1.8/i486-linux",  
"/usr/lib/ruby/1.8/i386-linux", "."]

... in the other hand rubygems has been installed  
in /usr/local/lib/site\_ruby/1.8/

$ ls -l /usr/local/lib/site\_ruby/1.8  
gemconfigure.rb  
i486-linux  
rubygems  
rubygems.rb  
ubygems.rb

So at this point I am confused ... Could someone help me understand what I am  
missing here or point me to a doc or howto

Cheers  
Vlad

---

<div class="post-metadata">

**Author:** ![Austin\_Ziegler5](https://yyz1.discourse-cdn.com/flex029/user_avatar/rubytalk.org/austin_ziegler5/32/1985_2.png) [@Austin\_Ziegler5](https://rubytalk.org/u/Austin_Ziegler5)\
**Post date:** [12 April 2006 15:06 UTC](https://rubytalk.org/t/using-gems-problem-loaderror/26604/2 "2006-04-12T15:06:32Z")

</div>

Try "require 'xml/simple'". One has to require the libraries that are  
represented in the gem, not the gem itself.

With some gems, you can autorequire the code by requiring\_gem-ing the  
gem, but this functionality may ultimately go away and it is dependent  
on each gem.

The xml-simple gem documentation should indicate what you must include.

-austin

> **···**
>
> On 4/12/06, Vladsialv Tchernev \<vladislav.tchernev@broadsign.com\> wrote:
> 
> > Hello all,  
> > I am a newbie with ruby and gems and I have this frustrating problem not being  
> > able to load any gem I install. I am running Ubuntu 5.10 and I have just  
> > installed ruby1.8 deb (1.8.4) and have compiled rubygems-0.8.11 without any  
> > problem. I am able to load rubygems (require 'rubygems') and I setup RUBYOPT  
> > var as advised in gems doc (export RUBYOPT=rubygems). However, when I try to  
> > load a gem ($ruby1.8 -e "require 'some\_gem' ") I always get an error (This is  
> > for xml-simple gem:
> 
> --  
> Austin Ziegler \* halostatue@gmail.com  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\* Alternate: austin@halostatue.ca

---

<div class="post-metadata">

**Author:** ![Vladsialv\_Tchernev](https://avatars.discourse-cdn.com/v4/letter/v/a8b319/32.png) [@Vladsialv\_Tchernev](https://rubytalk.org/u/Vladsialv_Tchernev)\
**Post date:** [12 April 2006 16:57 UTC](https://rubytalk.org/t/using-gems-problem-loaderror/26604/3 "2006-04-12T16:57:33Z")

</div>

Thank you Austin .. that was it.. I was using wrong libraries names

Cheers  
Vlad

> **···**
>
> On Wednesday 12 April 2006 11:06 am, Austin Ziegler wrote:
> 
> > On 4/12/06, Vladsialv Tchernev \<vladislav.tchernev@broadsign.com\> wrote:  
> > \> Hello all,  
> > \> I am a newbie with ruby and gems and I have this frustrating problem not  
> > \> being able to load any gem I install. I am running Ubuntu 5.10 and I have  
> > \> just installed ruby1.8 deb (1.8.4) and have compiled rubygems-0.8.11  
> > \> without any problem. I am able to load rubygems (require 'rubygems') and  
> > \> I setup RUBYOPT var as advised in gems doc (export RUBYOPT=rubygems).  
> > \> However, when I try to load a gem ($ruby1.8 -e "require 'some\_gem' ") I  
> > \> always get an error (This is for xml-simple gem:
> > 
> > Try "require 'xml/simple'". One has to require the libraries that are  
> > represented in the gem, not the gem itself.
> > 
> > With some gems, you can autorequire the code by requiring\_gem-ing the  
> > gem, but this functionality may ultimately go away and it is dependent  
> > on each gem.
> > 
> > The xml-simple gem documentation should indicate what you must include.
> > 
> > -austin  
> > --  
> > Austin Ziegler \* halostatue@gmail.com  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\* Alternate: austin@halostatue.ca
