gem problem

E

Elton Okada

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
 
T

Tim Hunter

Elton said:
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

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 it looks like you need to
require "atom/tools".
 
E

Elton Okada

Tim said:
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 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...
 
S

s.ross

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

Walter Wilfinger

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
 
J

Jim Tobin

Elton said:
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!
 

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
474,000
Messages
2,570,252
Members
46,848
Latest member
CristineKo

Latest Threads

Top