On Jan 25, 11:04 pm, Nathan Weizenbaum <[email protected]> wrote:
> You seem to be running Ruby at a high warning level. This is not
> recommended; Haml takes advantage of several features of Ruby that are
> (incorrectly, in my opinion) flagged as warnings. You can set the warning
> level via the -W flag for Ruby.

Thank you so much for your quick response. Indeed, I set the
environment variable RUBYOPT as follows in my bash shell:
   export RUBYOPT='-w rubygems'
Simply unset RUBYOPT, then the warnings are gone.

According to "The Ruby Programming Language":
   -W, -W2 --verbose
are all synonyms for -w. The it seems to avoid warning message from
haml, I can either delete the -w option, or use -W0. I can live with
such settings. However, I do believe haml code may be "cleaned" to
avoid such warnings even with the -w option. Other gems I've been
using does not produce such warnings with -w.

Thanks again,

Xiang-Jun


>
>
>
> On Tue, Jan 25, 2011 at 7:56 PM, xjl <[email protected]> wrote:
> > Hi,
>
> > I've just installed haml as a replacement of erb. I played around haml
> > a little bit, and got the following warning messages:
>
> > $ruby --version
> >   ---> ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]
>
> > $haml --version
> > /Library/Ruby/Gems/1.8/gems/haml-3.0.25/bin/../lib/haml/buffer.rb:153:
> > warning: statement not reached
> > /Library/Ruby/Gems/1.8/gems/haml-3.0.25/bin/../lib/haml/buffer.rb:156:
> > warning: statement not reached
> > /Library/Ruby/Gems/1.8/gems/haml-3.0.25/bin/../lib/haml/buffer.rb:156:
> > warning: statement not reached
> > /Library/Ruby/Gems/1.8/gems/haml-3.0.25/bin/../lib/haml/buffer.rb:156:
> > warning: statement not reached
> > /Library/Ruby/Gems/1.8/gems/haml-3.0.25/bin/../lib/haml/buffer.rb:153:
> > warning: statement not reached
> > /Library/Ruby/Gems/1.8/gems/haml-3.0.25/bin/../lib/haml/buffer.rb:153:
> > warning: statement not reached
> > /Library/Ruby/Gems/1.8/gems/haml-3.0.25/bin/../lib/haml/buffer.rb:153:
> > warning: statement not reached
> > /Library/Ruby/Gems/1.8/gems/haml-3.0.25/bin/../lib/haml/buffer.rb:156:
> > warning: statement not reached
> > Haml/Sass 3.0.25 (Classy Cassidy)
>
> > When tested on a simple hello.haml file, with the following content,
> > %strong{:class => "code", :id => "message"} Hello, World!
>
> > $haml hello.haml
> > I got even more warnings:
>
> > /Library/Ruby/Gems/1.8/gems/haml-3.0.25/bin/../lib/haml/buffer.rb:153:
> > warning: statement not reached
> > /Library/Ruby/Gems/1.8/gems/haml-3.0.25/bin/../lib/haml/buffer.rb:156:
> > warning: statement not reached
> > /Library/Ruby/Gems/1.8/gems/haml-3.0.25/bin/../lib/haml/buffer.rb:156:
> > warning: statement not reached
> > /Library/Ruby/Gems/1.8/gems/haml-3.0.25/bin/../lib/haml/buffer.rb:156:
> > warning: statement not reached
> > /Library/Ruby/Gems/1.8/gems/haml-3.0.25/bin/../lib/haml/buffer.rb:153:
> > warning: statement not reached
> > /Library/Ruby/Gems/1.8/gems/haml-3.0.25/bin/../lib/haml/buffer.rb:153:
> > warning: statement not reached
> > /Library/Ruby/Gems/1.8/gems/haml-3.0.25/bin/../lib/haml/buffer.rb:153:
> > warning: statement not reached
> > /Library/Ruby/Gems/1.8/gems/haml-3.0.25/bin/../lib/haml/buffer.rb:156:
> > warning: statement not reached
> > /Library/Ruby/Gems/1.8/gems/haml-3.0.25/bin/../lib/haml/../haml.rb:34:
> > warning: redefine init_rails
> > /Library/Ruby/Gems/1.8/gems/haml-3.0.25/bin/../lib/haml/precompiler.rb:
> > 959: warning: instance variable @line not initialized
> > /Library/Ruby/Gems/1.8/gems/haml-3.0.25/bin/../lib/haml/precompiler.rb:
> > 961: warning: instance variable @line not initialized
> > /Library/Ruby/Gems/1.8/gems/haml-3.0.25/bin/../lib/haml/engine.rb:171:
> > warning: instance variable @haml_buffer not initialized
> > <strong class='code' id='message'>Hello, World!</strong>
>
> > I also tested with Ruby 1.9.2 on Ubuntu Linux, with the same warning
> > messages.
>
> > I must have missed something obvious -- any help is greatly
> > appreciated.
>
> > Xiang-Jun
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Haml" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to
> > [email protected] <haml%[email protected]>.
> > For more options, visit this group at
> >http://groups.google.com/group/haml?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Haml" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to [email protected].
For more options, visit this group at http://groups.google.com/group/haml?hl=en.

Reply via email to