Forum: Ruby IRB require issues

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
8dba11fb458de3101593e92c2a873a78?d=identicon&s=25 Guest (Guest)
on 2007-07-06 03:29
is there a reason why saying require 'net/http' would return false?

i've been trying to figure out what's wrong with my installation, but i
see no reason why it refuses to load that one library, it works for
everything else i can think of...

thanks
B36cd736c906455db541f7c8e2478145?d=identicon&s=25 diego scataglini (Guest)
on 2007-07-06 03:42
(Received via mailing list)
False means that's already required.

Diego Scataglini
289cf19aa581c445915c072bf45c5e25?d=identicon&s=25 Todd Benson (Guest)
on 2007-07-06 03:44
(Received via mailing list)
On 7/5/07, Guest <Guest@bugmenot.com> wrote:
> is there a reason why saying require 'net/http' would return false?
>
> i've been trying to figure out what's wrong with my installation, but i
> see no reason why it refuses to load that one library, it works for
> everything else i can think of...
>
> thanks

Usually, this is because it is already loaded ...

irb(main):001:0> $LOADED_FEATURES.grep /net/
=> ["net/protocol.rb", "net/http.rb"]
irb(main):002:0> require 'net/http'  #already loaded, so should return
false
=> false

hth,
Todd
B36cd736c906455db541f7c8e2478145?d=identicon&s=25 Diego Scataglini (Guest)
on 2007-07-06 16:14
(Received via mailing list)
Nice one Todd,
I didn't know about $LOADED_FEATURES.
Thanks
This topic is locked and can not be replied to.