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

your ~/.irbrc has:

   require "rubygems"

···

On Feb 1, 2008, at 21:19 , peter@rubyrailways.com wrote:

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?

peter@rubyrailways.com 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

···

--
Jabber: sepp2k@jabber.org
ICQ: 205544826