# Gem problem

**URL:** <https://www.ruby-forum.com/t/gem-problem/132929>\
**Category:** Ruby\
**Created:** [March 25, 2008, 9:44pm UTC](https://www.ruby-forum.com/t/gem-problem/132929 "2008-03-25T21:44:35Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![eltonokada](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/58956e/32.png) [@eltonokada](https://www.ruby-forum.com/u/eltonokada)\
**Post date:** [March 25, 2008, 9:44pm UTC](https://www.ruby-forum.com/t/gem-problem/132929/1 "2008-03-25T21:44:35Z")

</div>

i installed atom-tools  
sudo gem install atom-tools

and i try to use in my code:  
require ‘rubygems’  
require ‘atom-tools’

i got this error:  
1.8/rubygems/custom\_require.rb:27:in `require’: no such file to  
load – atom-tools (LoadError)

anyone can help me ?  
thanks

---

<div class="post-metadata">

**Author:** ![eltonokada](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/58956e/32.png) [@eltonokada](https://www.ruby-forum.com/u/eltonokada)\
**Post date:** [March 25, 2008, 10:47pm UTC](https://www.ruby-forum.com/t/gem-problem/132929/2 "2008-03-25T22:47:51Z")

</div>

Elton Okada wrote:

> anyone can help me ?  
> thanks

The name of the gem is not necessarily the name of the thing you need to  
require. I don’t use this gem, but according to this web site:  
[http://code.necronomicorp.com/atom-tools](http://code.necronomicorp.com/atom-tools) it looks like you need to  
require “atom/tools”.

---

<div class="post-metadata">

**Author:** ![eltonokada](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/58956e/32.png) [@eltonokada](https://www.ruby-forum.com/u/eltonokada)\
**Post date:** [March 25, 2008, 11:09pm UTC](https://www.ruby-forum.com/t/gem-problem/132929/3 "2008-03-25T23:09:31Z")

</div>

Tim H. wrote:

> Elton Okada wrote:
> 
> > anyone can help me ?  
> > thanks
> 
> The name of the gem is not necessarily the name of the thing you need to  
> require. I don’t use this gem, but according to this web site:  
> [http://code.necronomicorp.com/atom-tools](http://code.necronomicorp.com/atom-tools) it looks like you need to  
> require “atom/tools”.

Yes, i change this name, and i also try with another libraries… always  
the same error, i think there is a problem with gem…

---

<div class="post-metadata">

**Author:** ![eltonokada](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/58956e/32.png) [@eltonokada](https://www.ruby-forum.com/u/eltonokada)\
**Post date:** [March 27, 2008, 4:04pm UTC](https://www.ruby-forum.com/t/gem-problem/132929/4 "2008-03-27T16:04:16Z")

</div>

On Wed, Mar 26, 2008 at 07:18:01AM +0900, s.ross wrote:

> # maybe some error
> 
> > > require ‘rubygems’  
> > > require ‘atom/tools’
> 
> # does this work?
> 
> Using irb, you get immediate feedback. If it works in irb but not your  
> program, check your .irbrc because it might require rubygems.

That’s almost certainly the problem in this case – that the following  
line is needed:

require ‘rubygems’

---

<div class="post-metadata">

**Author:** ![eltonokada](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/58956e/32.png) [@eltonokada](https://www.ruby-forum.com/u/eltonokada)\
**Post date:** [March 25, 2008, 11:19pm UTC](https://www.ruby-forum.com/t/gem-problem/132929/5 "2008-03-25T23:19:36Z")

</div>

On Mar 25, 2008, at 3:09 PM, Elton Okada wrote:

> > require “atom/tools”.
> 
> Yes, i change this name, and i also try with another libraries…  
> always  
> the same error, i think there is a problem with gem…

The way I usually approach this is in irb.

$ irb

> > require ‘atom/tools’

# maybe some error

> > require ‘rubygems’  
> > require ‘atom/tools’

# does this work?

Using irb, you get immediate feedback. If it works in irb but not your  
program, check your .irbrc because it might require rubygems.

---

<div class="post-metadata">

**Author:** ![eltonokada](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/58956e/32.png) [@eltonokada](https://www.ruby-forum.com/u/eltonokada)\
**Post date:** [March 27, 2008, 4:45pm UTC](https://www.ruby-forum.com/t/gem-problem/132929/6 "2008-03-27T16:45:08Z")

</div>

If your Ruby paths are set correctly, it’s probably because you haven’t  
loaded up RubyGems. I don’t blame you either. I ran into the same  
thing when I started and it took me a while to figure it out. There’s  
three ways you can do this.

1. Require ‘rubygems’ in your source file
2. Run the script with the -rubygems switch
3. Set the RUBYOPT environment variable to ‘rubygems’

More info is on the RubyGems User Guide:  
[http://docs.rubygems.org/read/chapter/3#page70](http://docs.rubygems.org/read/chapter/3#page70)

---

<div class="post-metadata">

**Author:** ![eltonokada](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/58956e/32.png) [@eltonokada](https://www.ruby-forum.com/u/eltonokada)\
**Post date:** [March 30, 2008, 6:56am UTC](https://www.ruby-forum.com/t/gem-problem/132929/7 "2008-03-30T06:56:26Z")

</div>

Elton Okada wrote:

> ```
> require 'atom-tools'
> 
> ```

Hi Elton,

I had the same misunderstanding. The atom-tools is a collection of  
tools, and you need to specify the appropriate tool by name.

There’s a README in the gem directory for this gem that lists them all,  
but in short, you probably want

require ‘atom/feed’

If your operating system is unix-like, you should be able to navigate  
down into your gem directory and get to the atom directory, underneath  
which you’ll see feed and others. So in unix form, the directory path  
makes sense for the require statement, since “feed” is a subdirectory of  
“atom”

Cheers!
