From: Robert Klemme Date: 2009-11-24T21:29:07+09:00 Subject: Re: Warning: instance variable @foo not initialized 2009/11/24 Seebs : > On 2009-11-24, Stefano Crocco wrote: >> If the warnings only annoy you, you should be able to disable them by not >> passing the -w option to ruby. If instead you're worried that they can mean >> there's something wrong, I think you don't need to. Most of the times, >> warnings issued by ruby are harmless. > > There's two issues. > > 1.  Actually, those warnings happen even without -w.  (Unless there's > something non-obvious passing the -w to Ruby that I didn't think about.) This is not what I am seeing: $ allruby -e 'p @foo' CYGWIN_NT-5.1 padrklemme1 1.5.25(0.156/4/2) 2008-06-12 19:34 i686 Cygwin ======================================== ruby 1.8.7 (2008-08-11 patchlevel 72) [i386-cygwin] nil ======================================== ruby 1.9.1p129 (2009-05-12 revision 23412) [i386-cygwin] nil $ allruby -we 'p @foo' CYGWIN_NT-5.1 padrklemme1 1.5.25(0.156/4/2) 2008-06-12 19:34 i686 Cygwin ======================================== ruby 1.8.7 (2008-08-11 patchlevel 72) [i386-cygwin] -e:1: warning: instance variable @foo not initialized nil ======================================== ruby 1.9.1p129 (2009-05-12 revision 23412) [i386-cygwin] -e:1: warning: instance variable @foo not initialized nil $ > 2.  I actually really DO want -w warnings for my code.  Is there a way to > do a require that suppresses warnings during parsing of the required code? You can use -W to have a bit more control over verbosity. Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/