# Cannot load installed gems

**URL:** <https://rubytalk.org/t/cannot-load-installed-gems/38134>\
**Category:** ruby-talk\
**Created:** [6 June 2007 01:53 UTC](https://rubytalk.org/t/cannot-load-installed-gems/38134 "2007-06-06T01:53:44Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ZHANG\_Yin](https://avatars.discourse-cdn.com/v4/letter/z/3d9bf3/32.png) [@ZHANG\_Yin](https://rubytalk.org/u/ZHANG_Yin)\
**Post date:** [6 June 2007 01:53 UTC](https://rubytalk.org/t/cannot-load-installed-gems/38134/1 "2007-06-06T01:53:44Z")

</div>

Hello there.

Well, I've installed hpricot using gem, and it works well in windows.  
But under my fedora 7, although gem told me that hpricot has been  
successfully installed(I did install gcc and make so that gem can  
compile the source code), I still can't load it into my program. Under  
irb, it just told me that 'no such file to load hpricot' when I type  
"require 'hpricot'".

I've also installed rails using gem under Linux. If I type 'rails -v'  
directly into the terminal, it works and told me it's 'rails 1.2.3', but  
"require 'rails'"(I don't know whether it'll work. Just to have a try)  
in irb won't work too, just like hpricot.

"ri hpricot" won't work too.

I can find hpricot and rails under '/usr/lib/ruby/gems/1.8/gems'. But it  
seems the ruby won't load libs in it.

What should I do ~~~~

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

---

<div class="post-metadata">

**Author:** ![ZHANG\_Yin](https://avatars.discourse-cdn.com/v4/letter/z/3d9bf3/32.png) [@ZHANG\_Yin](https://rubytalk.org/u/ZHANG_Yin)\
**Post date:** [6 June 2007 02:12 UTC](https://rubytalk.org/t/cannot-load-installed-gems/38134/2 "2007-06-06T02:12:11Z")

</div>

I've searched the forum and found one solution.

require 'rubygems'  
require 'hpricot'

It works, but seems a bit...

Under windows, a single "require 'hpricot'" will work, and I think it'll  
work under fedora 7 too.

Are there any solutions?

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

---

<div class="post-metadata">

**Author:** ![Eric\_Hodel1](https://avatars.discourse-cdn.com/v4/letter/e/a9adbd/32.png) [@Eric\_Hodel1](https://rubytalk.org/u/Eric_Hodel1)\
**Post date:** [6 June 2007 06:33 UTC](https://rubytalk.org/t/cannot-load-installed-gems/38134/3 "2007-06-06T06:33:31Z")

</div>

> Well, I've installed hpricot using gem, and it works well in windows.  
> But under my fedora 7, although gem told me that hpricot has been  
> successfully installed(I did install gcc and make so that gem can  
> compile the source code), I still can't load it into my program. Under  
> irb, it just told me that 'no such file to load hpricot' when I type  
> "require 'hpricot'".
> 
> I've also installed rails using gem under Linux. If I type 'rails -v'  
> directly into the terminal, it works and told me it's 'rails 1.2.3', but  
> "require 'rails'"(I don't know whether it'll work. Just to have a try)  
> in irb won't work too, just like hpricot.
> 
> "ri hpricot" won't work too.

ri Hpricot

> I can find hpricot and rails under '/usr/lib/ruby/gems/1.8/gems'. But it  
> seems the ruby won't load libs in it.

What does `gem env` say?

What does `gem list` say?

> **···**
>
> On Jun 5, 2007, at 18:53, ZHANG Yin wrote:

---

<div class="post-metadata">

**Author:** ![ZHANG\_Yin](https://avatars.discourse-cdn.com/v4/letter/z/3d9bf3/32.png) [@ZHANG\_Yin](https://rubytalk.org/u/ZHANG_Yin)\
**Post date:** [6 June 2007 07:24 UTC](https://rubytalk.org/t/cannot-load-installed-gems/38134/4 "2007-06-06T07:24:28Z")

</div>

Eric Hodel wrote:

> > "require 'rails'"(I don't know whether it'll work. Just to have a try)  
> > in irb won't work too, just like hpricot.
> > 
> > "ri hpricot" won't work too.
> 
> ri Hpricot

Oh! I see, ri Hpricot works.

> > I can find hpricot and rails under '/usr/lib/ruby/gems/1.8/gems'.  
> > But it  
> > seems the ruby won't load libs in it.
> 
> What does `gem env` say?
> 
> What does `gem list` say?

gem env:

RubyGems Environment:  
&nbsp;&nbsp;- VERSION: 0.9.2 (0.9.2)  
&nbsp;&nbsp;- INSTALLATION DIRECTORY: /usr/lib/ruby/gems/1.8  
&nbsp;&nbsp;- GEM PATH:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- /usr/lib/ruby/gems/1.8  
&nbsp;&nbsp;- REMOTE SOURCES:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- [http://gems.rubyforge.org](http://gems.rubyforge.org)

gem list:

\*\*\* LOCAL GEMS \*\*\*

actionmailer (1.3.3)  
&nbsp;&nbsp;&nbsp;&nbsp;Service layer for easy email delivery and testing.

actionpack (1.13.3)  
&nbsp;&nbsp;&nbsp;&nbsp;Web-flow and rendering framework putting the VC in MVC.

actionwebservice (1.2.3)  
&nbsp;&nbsp;&nbsp;&nbsp;Web service support for Action Pack.

activerecord (1.15.3)  
&nbsp;&nbsp;&nbsp;&nbsp;Implements the ActiveRecord pattern for ORM.

activesupport (1.4.2)  
&nbsp;&nbsp;&nbsp;&nbsp;Support and utility classes used by the Rails framework.

hpricot (0.5.145)  
&nbsp;&nbsp;&nbsp;&nbsp;a swift, liberal HTML parser with a fantastic library

rails (1.2.3)  
&nbsp;&nbsp;&nbsp;&nbsp;Web-application framework with template engine, control-flow layer,  
&nbsp;&nbsp;&nbsp;&nbsp;and ORM.

rake (0.7.3)  
&nbsp;&nbsp;&nbsp;&nbsp;Ruby based make-like utility.

sources (0.0.1)  
&nbsp;&nbsp;&nbsp;&nbsp;This package provides download sources for remote gem installation

but "require 'hpricot'" won't work~~

> **···**
>
> > On Jun 5, 2007, at 18:53, ZHANG Yin wrote:
> 
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).

---

<div class="post-metadata">

**Author:** ![Todd\_Benson](https://avatars.discourse-cdn.com/v4/letter/t/34f0e0/32.png) [@Todd\_Benson](https://rubytalk.org/u/Todd_Benson)\
**Post date:** [8 June 2007 12:51 UTC](https://rubytalk.org/t/cannot-load-installed-gems/38134/5 "2007-06-08T12:51:16Z")

</div>

When you installed under windows, most likely you selected the option  
in the one-click installer that says "Enable rubygems".

You can make Fedora act the same (untested) by setting your  
environment to use RUBYOPT:

export RUBYOPT=-rrubygems

hth,  
Todd

> **···**
>
> On 6/5/07, ZHANG Yin \<gsofhon@gmail.com\> wrote:
> 
> > I've searched the forum and found one solution.
> > 
> > require 'rubygems'  
> > require 'hpricot'
> > 
> > It works, but seems a bit...
> > 
> > Under windows, a single "require 'hpricot'" will work, and I think it'll  
> > work under fedora 7 too.
> > 
> > Are there any solutions?

---

<div class="post-metadata">

**Author:** ![Eric\_Hodel1](https://avatars.discourse-cdn.com/v4/letter/e/a9adbd/32.png) [@Eric\_Hodel1](https://rubytalk.org/u/Eric_Hodel1)\
**Post date:** [6 June 2007 17:24 UTC](https://rubytalk.org/t/cannot-load-installed-gems/38134/6 "2007-06-06T17:24:29Z")

</div>

> Eric Hodel wrote:
> 
> > > "require 'rails'"(I don't know whether it'll work. Just to have a try)  
> > > in irb won't work too, just like hpricot.
> > > 
> > > "ri hpricot" won't work too.
> > 
> > ri Hpricot
> 
> Oh! I see, ri Hpricot works.

Then you probably forgot to require 'rubygems' before require 'hpricot'.

> **···**
>
> On Jun 6, 2007, at 00:24, ZHANG Yin wrote:
> 
> > > On Jun 5, 2007, at 18:53, ZHANG Yin wrote:
> 
> > gem env:
> > 
> > [...]
> > 
> > gem list:
> > 
> > \*\*\* LOCAL GEMS \*\*\*
> > 
> > [...]

---

<div class="post-metadata">

**Author:** ![ZHANG\_Yin](https://avatars.discourse-cdn.com/v4/letter/z/3d9bf3/32.png) [@ZHANG\_Yin](https://rubytalk.org/u/ZHANG_Yin)\
**Post date:** [9 June 2007 11:34 UTC](https://rubytalk.org/t/cannot-load-installed-gems/38134/7 "2007-06-09T11:34:11Z")

</div>

Todd Benson wrote:

> **···**
>
> > On 6/5/07, ZHANG Yin \<gsofhon@gmail.com\> wrote:
> > 
> > > Are there any solutions?
> > 
> > When you installed under windows, most likely you selected the option  
> > in the one-click installer that says "Enable rubygems".
> > 
> > You can make Fedora act the same (untested) by setting your  
> > environment to use RUBYOPT:
> > 
> > export RUBYOPT=-rrubygems
> > 
> > hth,  
> > Todd
> 
> Well, that's great! Thanks a lot!
> 
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).
