From: Tony Arcieri Date: 2010-02-18T12:29:42+09:00 Subject: Re: rubyful_soup.rb - error and warning message --000e0cd754babbdb47047fd793af Content-Type: text/plain; charset=ISO-8859-1 Hi, I'm afraid I can't help you with your problem. But please, read on! Rubyful Soup is a name I have not heard of since about 2006. If you go to the Rubyful Soup homepage the author notes: "Rubyful Soup is no longer being maintained. I recommend you use hpricot instead." That very statement shows the project's age. Hpricot itself has not been maintained by its original author _why, who has gone AWOL. Nowadays you should probably be using Nokogiri: http://nokogiri.org/ On Wed, Feb 17, 2010 at 5:38 PM, Ashita Hara wrote: > Hello Group, > > version: ruby 1.9.1p378 > > source: > > $ cat kitty.rb > > #!/usr/bin/ruby -w > require 'rubyful_soup' > > When I run the source code, it gave me the following error: > > $ ./kitty.rb > > /usr/local/ruby/lib/ruby/gems/1.9.1/gems/rubyful_soup-1.0.4/lib/rubyful_soup.rb:238: > warning: mismatched indentations at 'end' with 'if' at 233 > ./kitty.rb:3:in `require': > > /usr/local/ruby/lib/ruby/gems/1.9.1/gems/rubyful_soup-1.0.4/lib/rubyful_soup.rb:233: > syntax error, unexpected ':', expecting keyword_then or ';' or '\n' > (SyntaxError) > > /usr/local/ruby/lib/ruby/gems/1.9.1/gems/rubyful_soup-1.0.4/lib/rubyful_soup.rb:426: > syntax error, unexpected keyword_end, expecting $end > from ./kitty.rb:3:in `
' > > 232: @attrs = @attr_list.inject({}) do |m,v| > 233: if v[1][0] == ?" and v[1][-1] == ?": > 234: v[1] = v[1][1..-2] > 235: end > 236: m[v[0]] = v[1] > 237: m > 238: end > > I removed the extra colon at the end of line 233 then I get a warning > message: > > $ ./kitty.rb > > /usr/local/ruby/lib/ruby/gems/1.9.1/gems/rubyful_soup-1.0.4/lib/rubyful_soup.rb:18: > warning: variable $KCODE is no longer effective; ignored > > /usr/local/ruby/lib/ruby/gems/1.9.1/gems/rubyful_soup-1.0.4/lib/rubyful_soup.rb:230: > warning: method redefined; discarding old attrs > > I heard that we need to use --charset option to fix this problem > however, I did not find this option in ruby -h or man ruby. > Any guidance will be greatly appreciated. > > Regards, > Ashita > -- > Posted via http://www.ruby-forum.com/. > > -- Tony Arcieri Medioh! A Kudelski Brand --000e0cd754babbdb47047fd793af--