[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

gem problem

Elton Okada

3/25/2008 8:44:00 PM

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
--
Posted via http://www.ruby-....

5 Answers

Tim Hunter

3/25/2008 9:41:00 PM

0

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

--
RMagick: http://rmagick.ruby...
RMagick 2: http://rmagick.ruby...rmagick2.html

Elton Okada

3/25/2008 10:09:00 PM

0

Tim Hunter 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/... 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...

--
Posted via http://www.ruby-....

Steve Ross

3/25/2008 10:18:00 PM

0

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

> Tim Hunter 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/... 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...

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.

Walter Wilfinger

3/27/2008 3:45:00 PM

0

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/chapte...
--
Posted via http://www.ruby-....

Jim Tobin

3/30/2008 4:56:00 AM

0

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!
--
Posted via http://www.ruby-....