From: Logan Capaldo Date: 2007-08-12T21:55:40+09:00 Subject: Re: NameError - Scruffy and Gruff - ------=_Part_21838_21253385.1186923341108 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On 8/12/07, Stefan Rusterholz wrote: > > Logan Capaldo wrote: > > On 8/12/07, Ams Lone wrote: > >> => 0) > >> `gem_original_require' > >> from d:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > >> `require' > >> from Scruffy.rb:2 > >> >Exit code: 1 > > > > > > Don't name your script scruffy.rb. Ruby will always look in the current > > directory first for files to require. You are requiring your own script > > file > > by accident. :) > > Actually it won't. "." is in $: the last entry. Sorry, I said "ruby" when I really meant "gems": C:\Documents and Settings\Logan>type mechanize.rb puts "I am not the real mechanize" C:\Documents and Settings\Logan>gem list mechanize *** LOCAL GEMS *** mechanize (0.6.4) Mechanize provides automated web-browsing C:\Documents and Settings\Logan>irb irb(main):001:0> require 'rubygems' => false irb(main):002:0> require 'mechanize' I am not the real mechanize => true This is because rubygems rescues LoadError to install its magic IIRC. If ruby can find the lib without gem's help, the path to the gem never gets added to $LOAD_PATH Regards > Stefan > -- > Posted via http://www.ruby-forum.com/. > > ------=_Part_21838_21253385.1186923341108--