Irb can see the gem but ruby can't

Hey all,

I am not sure if this is a Leopard on Ruby problem or some other quirk
(or
maybe I am just horribly overlooking something) but…:

Macintosh:manav mbp$ irb

require ‘yahoofinance’
=> true

Macintosh:manav mbp$ cat yahoo_test.rb
require ‘yahoofinance’
Macintosh:manav mbp$ ruby yahoo_test.rb
yahoo_test.rb:1:in `require’: no such file to load – yahoofinance
(LoadError)
from yahoo_test.rb:1

i.e. irb can see the gem but ruby can’t…
Any ideas?

Cheers,
Peter

On Feb 1, 2008, at 21:19 , [email protected] wrote:

yahoo_test.rb:1:in `require’: no such file to load – yahoofinance
(LoadError)
from yahoo_test.rb:1

i.e. irb can see the gem but ruby can’t…
Any ideas?

your ~/.irbrc has:

require “rubygems”

[email protected] wrote:

i.e. irb can see the gem but ruby can’t…
Any ideas?

Probably your .irbrc requires rubygems while your script doesn’t.

HTH,
Sebastian

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs