# Rubyful\_soup.rb - error and warning message

**URL:** <https://www.ruby-forum.com/t/rubyful-soup-rb-error-and-warning-message/183643>\
**Category:** Ruby\
**Created:** [February 18, 2010, 1:38am UTC](https://www.ruby-forum.com/t/rubyful-soup-rb-error-and-warning-message/183643 "2010-02-18T01:38:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ashita](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/2bfe46/32.png) [@ashita](https://www.ruby-forum.com/u/ashita)\
**Post date:** [February 18, 2010, 1:38am UTC](https://www.ruby-forum.com/t/rubyful-soup-rb-error-and-warning-message/183643/1 "2010-02-18T01:38:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ashita](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/2bfe46/32.png) [@ashita](https://www.ruby-forum.com/u/ashita)\
**Post date:** [February 18, 2010, 4:30am UTC](https://www.ruby-forum.com/t/rubyful-soup-rb-error-and-warning-message/183643/2 "2010-02-18T04:30:15Z")

</div>

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:

> **[Overview](https://nokogiri.org/)**
>
> The Official Tutorial Archive™ of Nokogiri®

---

<div class="post-metadata">

**Author:** ![ashita](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/2bfe46/32.png) [@ashita](https://www.ruby-forum.com/u/ashita)\
**Post date:** [February 18, 2010, 5:17am UTC](https://www.ruby-forum.com/t/rubyful-soup-rb-error-and-warning-message/183643/3 "2010-02-18T05:17:07Z")

</div>

Hello Tony,

Thank you for your advise. I will try nokogiri.

Regards,  
Ashita

Tony A. wrote:

> 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/](http://nokogiri.org/)
