"rake1.9 test" error with Ruby1.9 in master branch

19 views
Skip to first unread message

Iñaki Baz Castillo

unread,
Oct 30, 2009, 10:46:37 AM10/30/09
to nokogi...@googlegroups.com
Hi, after applying the commit
http://github.com/tenderlove/nokogiri/commit/597195ff8fe471e5350581c2d5cce704fcf87439

I get errors when running "rake1.9 test" (using Ruby 1.9.1p243):


/usr/src/ruby/nokogiri1.9# rake1.9
(in /usr/src/ruby/nokogiri1.9)
warning: couldn't activate the debugging plugin, skipping
cp tmp/x86_64-linux/nokogiri/1.9.1/nokogiri.so lib/nokogiri/nokogiri.so
/usr/local/bin/ruby1.9 -w -Ilib:ext:bin:test -e 'require "rubygems";
require "test/unit"; require "test/css/test_nthiness.rb"; require
"test/css/test_parser.rb"; require "test/css/test_tokenizer.rb";
require "test/css/test_xpath_visitor.rb"; require
"test/ffi/test_document.rb"; require "test/html/sax/test_parser.rb";
require "test/html/sax/test_parser_context.rb"; require
"test/html/test_builder.rb"; require "test/html/test_document.rb";
require "test/html/test_document_encoding.rb"; require
"test/html/test_document_fragment.rb"; require
"test/html/test_element_description.rb"; require
"test/html/test_named_characters.rb"; require
"test/html/test_node.rb"; require "test/html/test_node_encoding.rb";
require "test/test_convert_xpath.rb"; require
"test/test_css_cache.rb"; require "test/test_gc.rb"; require
"test/test_memory_leak.rb"; require "test/test_nokogiri.rb"; require
"test/test_reader.rb"; require "test/test_xslt_transforms.rb"; require
"test/xml/node/test_save_options.rb"; require
"test/xml/node/test_subclass.rb"; require
"test/xml/sax/test_parser.rb"; require
"test/xml/sax/test_parser_context.rb"; require
"test/xml/sax/test_push_parser.rb"; require "test/xml/test_attr.rb";
require "test/xml/test_attribute_decl.rb"; require
"test/xml/test_builder.rb"; require "test/xml/test_cdata.rb"; require
"test/xml/test_comment.rb"; require "test/xml/test_document.rb";
require "test/xml/test_document_encoding.rb"; require
"test/xml/test_document_fragment.rb"; require "test/xml/test_dtd.rb";
require "test/xml/test_dtd_encoding.rb"; require
"test/xml/test_element_content.rb"; require
"test/xml/test_element_decl.rb"; require
"test/xml/test_entity_decl.rb"; require
"test/xml/test_entity_reference.rb"; require
"test/xml/test_namespace.rb"; require "test/xml/test_node.rb"; require
"test/xml/test_node_attributes.rb"; require
"test/xml/test_node_encoding.rb"; require "test/xml/test_node_set.rb";
require "test/xml/test_parse_options.rb"; require
"test/xml/test_processing_instruction.rb"; require
"test/xml/test_reader_encoding.rb"; require
"test/xml/test_relax_ng.rb"; require "test/xml/test_schema.rb";
require "test/xml/test_syntax_error.rb"; require
"test/xml/test_text.rb"; require "test/xml/test_unparented_node.rb";
require "test/xml/test_xpath.rb"'
/usr/local/lib/ruby1.9/1.9.1/test/unit/assertions.rb:31: warning:
shadowing outer local variable - line
/usr/src/ruby/nokogiri1.9/lib/nokogiri/xml/fragment_handler.rb:33:
warning: shadowing outer local variable - ns
/usr/src/ruby/nokogiri1.9/lib/nokogiri/css/generated_parser.rb:645:
warning: mismatched indentations at 'end' with 'module' at 11
/usr/src/ruby/nokogiri1.9/lib/nokogiri/css/generated_parser.rb:646:
warning: mismatched indentations at 'end' with 'module' at 10
/usr/src/ruby/nokogiri1.9/test/helper.rb:14: libxml version info:
{"warnings"=>[], "nokogiri"=>"1.3.3",
"libxml"=>{"binding"=>"extension", "compiled"=>"2.6.32",
"loaded"=>"2.6.32"}}
/usr/src/ruby/nokogiri1.9/test/xml/test_document_fragment.rb:120:
warning: shadowing outer local variable - ns
/usr/src/ruby/nokogiri1.9/test/xml/test_node.rb:358: warning:
shadowing outer local variable - ns
Loaded suite -e
Started
....................................................................................................................................................FE...............................................................F.............................................................................................................F..................................................................EF..................................................................................................................................................................FF.F..................................................................................................................................................................................................................................................
Finished in 4.146061 seconds.

1) Failure:
test_default_to_encoding_from_string(Nokogiri::HTML::TestDocumentEncoding)
[/usr/src/ruby/nokogiri1.9/test/html/test_document_encoding.rb:35]:
<"UTF-8"> expected but was
<"charset=UTF-8">.

2) Error:
test_encoding(Nokogiri::HTML::TestDocumentEncoding):
Encoding::CompatibilityError: incompatible encoding regexp match
(Shift_JIS regexp with UTF-8 string)
/usr/src/ruby/nokogiri1.9/test/html/test_document_encoding.rb:14:in
`test_encoding'

3) Failure:
test_inner_html(Nokogiri::HTML::TestNodeEncoding)
[/usr/src/ruby/nokogiri1.9/test/html/test_node_encoding.rb:14]:
<"Shift_JIS"> expected but was
<"UTF-8">.

4) Failure:
test_entities(Nokogiri::XML::TestDTDEncoding)
[/usr/src/ruby/nokogiri1.9/test/xml/test_dtd_encoding.rb:17]:
<nil> expected but was
<"UTF-8">.

5) Error:
test_encoding(Nokogiri::XML::TestDocumentEncoding):
NoMethodError: undefined method `encoding' for nil:NilClass
/usr/src/ruby/nokogiri1.9/test/xml/test_document_encoding.rb:17:in
`test_encoding'

6) Failure:
test_url(Nokogiri::XML::TestDocumentEncoding)
[/usr/src/ruby/nokogiri1.9/test/xml/test_document_encoding.rb:13]:
<nil> expected but was
<"UTF-8">.

7) Failure:
test_namespace(Nokogiri::XML::TestNodeEncoding)
[/usr/src/ruby/nokogiri1.9/test/xml/test_node_encoding.rb:72]:
<"UTF-8"> expected but was
<nil>.

8) Failure:
test_namespace_as_hash(Nokogiri::XML::TestNodeEncoding)
[/usr/src/ruby/nokogiri1.9/test/xml/test_node_encoding.rb:91]:
<"UTF-8"> expected but was
<nil>.

9) Failure:
test_serialize_encoding_html(Nokogiri::XML::TestNodeEncoding)
[/usr/src/ruby/nokogiri1.9/test/xml/test_node_encoding.rb:28]:
<"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"
\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html
xmlns=\"http://www.w3.org/1999/xhtml\"
xmlns=\"http://www.w3.org/1999/xhtml\">\n <head>\n <meta
http-equiv=\"Content-Type\" content=\"text/html; charset=Shift_JIS\"
/>\n <meta http-equiv=\"Content-Script-Type\"
content=\"text/javascript\" />\n <meta
http-equiv=\"Content-Style-Type\" content=\"text/css\" />\n <meta
name=\"Description\" content=\"「ハッキング」から�\x80�今晩のおかず�\x80�ま
でを手広くカバーする巨大掲示板群『2ちゃんねる�\x80�へようこそ��\x81\" />\n <meta
name=\"KeyWords\" content=\"2ちゃんね��\x8B, 掲示板, 2ch, BBS\" />\n <meta
name=\"Author\" content=\"2ちゃんね��\x8B\" />\n <meta
name=\"verify-v1\"
content=\"hMevVuWJIPYrUj9ItfRJByoLNIpyhnrWaywiH+IFocU=\" />\n
<title>&#xFF12;&#x3061;&#x3083;&#x3093;&#x306D;&#x308B;&#x63B2;&#x793A;&#x677F;&#x3078;&#x3088;&#x3046;&#x3053;&#x305D;</title>\n
<style type=\"text/css\" media=\"all\">\n<![CDATA[\n@import
url(2ch_top.css);\n]]>\n </style>\n
<script>\n<![CDATA[\n<!--\nfunction
fcs(){document.f.STR.focus();}\n-->\n]]>\n </script>\n </head>\n
<body onload=\"document.f.STR.focus()\">\n\n<div id=\"wrapper\">\n<div
id=\"header\">\n<div id=\"header_inside\">\n<div
class=\"header_left\">\n<a href=\"http://www2.2ch.net/2ch.html\"><img
src=\"images/2ch_logo.gif\" width=\"151\" height=\"40\"
alt=\"2ちゃんね��\x8B\" align=\"middle\" border=\"0\" /></a><a
href=\"http://www2.2ch.net/2ch.html\">&#x63B2;&#x793A;&#x677F;</a>&#xFF5C;\n<a
href=\"http://c.2ch.net/\">imode</a>&#xFF5C;<a
href=\"http://orz.2ch.io/top.html\">&#x643A;&#x5E2F;orz</a>&#xFF5C;<a
href=\"http://p2.2ch.net/\">&#x30D3;&#x30E5;&#x30FC;&#x30A2;p2</a>\n</div>\n\n<div
class=\"senna_banner\">\n\n<a
href=\"http://razil.jp/product/senna/\"><img
src=\"images/senna88x31.gif\" width=\"88\" height=\"31\" alt=\"Senna\"
align=\"middle\" border=\"0\" /></a>\n</div>\n<div
class=\"header_right\">\n<!---find 2ch form --->\n<form method=\"GET\"
name=\"f\" action=\"http://find.2ch.net/\" style=\"margin:0px\"
id=\"f\">\n<input size=\"25\" name=\"STR\" value=\"\"
class=\"form_input\" /><select name=\"TYPE\"
class=\"form_select\"><option
value=\"BODY\">&#x672C;&#x6587;</option><option value=\"TITLE\"
selected=\"selected\">&#x30B9;&#x30EC;&#x30C3;&#x30C9;&#x30BF;&#x30A4;&#x30C8;&#x30EB;</option><option
value=\"POSTERS\">&#x6295;&#x7A3F;&#x8005;</option></select><input
type=\"image\" src=\"images/search_button.gif\" alt=\"検索\"
class=\"form_button\" /><br /><input type=\"hidden\" name=\"BBS\"
value=\"ALL\" /><input type=\"hidden\" name=\"ENCODING\"
value=\"SJIS\" /><input type=\"hidden\" name=\"COUNT\" value=\"50\"
/><div class=\"caption\">&#x672C;&#x6587;&#x691C;&#x7D22;&#x3084;&#x691C;&#x7D22;&#x8A2D;&#x5B9A;&#x306F;<a
href=\"http://find.2ch.net/moritapo/notlogin.php\">&#x30ED;&#x30B0;&#x30A4;&#x30F3;</a><a
href=\"http://find.2ch.net/moritapo/welcome/\">&#xBB;&#x8A73;&#x7D30;</a></div>\n\n</form>\n</div>\n</div><!---
header_inside --->\n</div><!--- end of header--->\n\n<div
id=\"under_header\">\n<a
href=\"http://newsnavi.2ch.net/\">&#x30CB;&#x30E5;&#x30FC;&#x30B9;</a>&#xFF5C;<a
href=\"http://headline.2ch.net/bbynews/\">&#x30D8;&#x30C3;&#x30C9;&#x30E9;&#x30A4;&#x30F3;</a>&#xFF5C;<a
href=\"http://epg.2ch.net/\">&#x30C6;&#x30EC;&#x30D3;&#x6B04;</a>&#xFF5C;<a
href=\"http://www.2ch.net/kakolog.html\">&#x904E;&#x53BB;&#x30ED;&#x30B0;&#x5009;&#x5EAB;</a>\n\n</div><!---
end of under header--->\n\n<div id=\"main\">\n<iframe
src=\"http://cast.texpo.jp/2chtop/main_frame.html\" width=\"100%\"
height=\"550\" scrolling=\"no\" border=\"0\"
frameborder=\"0\"></iframe>\n</div><!--- end of main--->\n\n<div
id=\"footer_menu\">\n<div class=\"guide\">\n<a
href=\"http://info.2ch.net/guide/\">&#x4F7F;&#x3044;&#x65B9;&#xFF06;&#x6CE8;&#x610F;</a>&#xFF5C;<a
href=\"http://info.2ch.net/guide/adv.html#saku_guide\">&#x524A;&#x9664;&#x30AC;&#x30A4;&#x30C9;&#x30E9;&#x30A4;&#x30F3;</a>&#xFF5C;<a
href=\"http://www2.2ch.net/2ch2.html\">&#x62E1;&#x5F35;&#x7248;&#x30E1;&#x30CB;&#x30E5;&#x30FC;</a>&#xFF5C;<a
href=\"http://info.2ch.net/blog.html\">&#x3072;&#x308D;&#x3086;&#x304D;&#x65E5;&#x8A18;</a>&#xFF5C;<a
href=\"http://www.2ch.net/ad.html\">&#x5E83;&#x544A;&#x306E;&#x3054;&#x6848;&#x5185;</a>\n\n</div>\n\n<div
class=\"service\">\n<iframe
src=\"http://cast.texpo.jp/2chtop/moritapo_frame.html\" width=\"100%\"
height=\"50\" scrolling=\"no\" border=\"0\"
frameborder=\"0\"></iframe>\n</div>\n\n<div class=\"banner\">\n<a
href=\"http://livede55.com/\" target=\"_blank\"><img
src=\"http://www2.livede55.com/2ch_468_60_13.gif\" width=\"468\"
height=\"60\" border=\"0\" alt=\"ライブチャット\" /></a><br /><br /><a
href=\"http://www.bb-chat.tv/\" target=\"_blank\"><img height=\"60\"
src=\"http://img.bbchat.tv/images/bannar/46860-3.gif\" width=\"468\"
border=\"0\" /></a><br /></div>\n\n<div
class=\"condition\">\n&#xFF12;&#x3061;&#x3083;&#x3093;&#x306D;&#x308B;&#x306E;&#x3054;&#x5229;&#x7528;&#x306F;&#x5229;&#x7528;&#x8005;&#x5404;&#x4F4D;&#x306E;&#x3054;&#x5224;&#x65AD;&#x306B;&#x304A;&#x4EFB;&#x305B;&#x3057;&#x3066;&#x3044;&#x307E;&#x3059;&#xFF5C;<a
href=\"precautions.html\">2ch&#x306E;&#x30C7;&#x30FC;&#x30BF;&#x5229;&#x7528;&#x306B;&#x3064;&#x3044;&#x3066;</a>\n\n</div>\n</div><!---
end of footer_menu--->\n\n\n<div id=\"footer\">\n<div
class=\"footer_left\">\n<a href=\"http://www.bunka.go.jp/jiyuriyo/\"
target=\"_blank\">\n<img
src=\"http://www.dd.iij4u.or.jp/‾cap/y_3copyok.jpg\" width=\"184\"
height=\"31\" border=\"0\" alt=\"自由利用マーク\" /></a>\n</div>\n\n<div
class=\"footer_right\">\n<a href=\"http://count.2ch.net/?index\"
target=\"_blank\">\n<img src=\"http://count.2ch.net/ct.php/index\"
width=\"88\" height=\"31\" border=\"0\" alt=\"ちゃっかりカウンター\"
/></a>\n\n\n</div>\n</div><!---end of footer--->\n\n</div><!--- end of
wrapper--->\n</body>\n</html>\n"> expected but was
<"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"
\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html
xmlns=\"http://www.w3.org/1999/xhtml\"
xmlns=\"http://www.w3.org/1999/xhtml\">\n <head>\n <meta
http-equiv=\"Content-Type\" content=\"text/html; charset=Shift_JIS\"
/>\n <meta http-equiv=\"Content-Script-Type\"
content=\"text/javascript\" />\n <meta
http-equiv=\"Content-Style-Type\" content=\"text/css\" />\n <meta
name=\"Description\" content=\"縲後ワ繝く繝ウ繧ー縲阪°繧峨\" />\n
</head>\n</html>\n">.

790 tests, 2357 assertions, 7 failures, 2 errors, 0 skips
rake aborted!
Command failed with status (1): [/usr/local/bin/ruby1.9 -w -Ilib:ext:bin:te...]


--
Iñaki Baz Castillo
<i...@aliax.net>

Aaron Patterson

unread,
Oct 30, 2009, 11:24:44 AM10/30/09
to nokogi...@googlegroups.com
On Fri, Oct 30, 2009 at 7:46 AM, Iñaki Baz Castillo <i...@aliax.net> wrote:
>
> Hi, after applying the commit
>  http://github.com/tenderlove/nokogiri/commit/597195ff8fe471e5350581c2d5cce704fcf87439
>
> I get errors when running "rake1.9 test" (using Ruby 1.9.1p243):

I don't. :-)

You might need to upgrade libxml2. Encoding handling was a little
broken in older versions of libxml2.

--
Aaron Patterson
http://tenderlovemaking.com/

Iñaki Baz Castillo

unread,
Oct 31, 2009, 8:41:42 AM10/31/09
to nokogi...@googlegroups.com
2009/10/30 Aaron Patterson <aaron.p...@gmail.com>:

>
> On Fri, Oct 30, 2009 at 7:46 AM, Iñaki Baz Castillo <i...@aliax.net> wrote:
>>
>> Hi, after applying the commit
>>  http://github.com/tenderlove/nokogiri/commit/597195ff8fe471e5350581c2d5cce704fcf87439
>>
>> I get errors when running "rake1.9 test" (using Ruby 1.9.1p243):
>
> I don't.  :-)
>
> You might need to upgrade libxml2.  Encoding handling was a little
> broken in older versions of libxml2.

I've the following version of libxml2 (Debian Lenny 64 bits):

libxml2 2.6.32.dfsg-5+lenny1
libxml2-dev 2.6.32.dfsg-5+lenny1


Could you please tell me the required version? Thanks.

Iñaki Baz Castillo

unread,
Oct 31, 2009, 8:47:05 AM10/31/09
to nokogi...@googlegroups.com
2009/10/31 Iñaki Baz Castillo <i...@aliax.net>:

>> You might need to upgrade libxml2.  Encoding handling was a little
>> broken in older versions of libxml2.
>
> I've the following version of libxml2 (Debian Lenny 64 bits):
>
>  libxml2                  2.6.32.dfsg-5+lenny1
>  libxml2-dev            2.6.32.dfsg-5+lenny1

I've installed right now libxml2 2.7.6.dfsg-1 (Debian Sid version) and
it still fails but gets less errors:

1) Error:


test_encoding(Nokogiri::HTML::TestDocumentEncoding):
Encoding::CompatibilityError: incompatible encoding regexp match
(Shift_JIS regexp with UTF-8 string)
/usr/src/ruby/nokogiri1.9/test/html/test_document_encoding.rb:14:in
`test_encoding'

2) Failure:
test_to_xhtml(Nokogiri::HTML::TestDocumentFragment)
[/usr/src/ruby/nokogiri1.9/test/html/test_document_fragment.rb:95]:
<"<span>foo<br /></span><span>bar</span>"> expected but was
<"<span>foo<br></span><span>bar</span>">.

3) Failure:
test_inner_html(Nokogiri::HTML::TestNodeEncoding)
[/usr/src/ruby/nokogiri1.9/test/html/test_node_encoding.rb:14]:
<"Shift_JIS"> expected but was
<"UTF-8">.

790 tests, 2371 assertions, 2 failures, 1 errors, 0 skips

However, how is possible that the available gem version passes all the
tests on my system?

Iñaki Baz Castillo

unread,
Oct 31, 2009, 8:51:02 AM10/31/09
to nokogi...@googlegroups.com
2009/10/31 Iñaki Baz Castillo <i...@aliax.net>:
> I've installed right now libxml2 2.7.6.dfsg-1 (Debian Sid version) and
> it still fails but gets less errors:
>
> 790 tests, 2371 assertions, 2 failures, 1 errors, 0 skips
>
> However, how is possible that the available gem version passes all the
> tests on my system?


Ops, after doing "rake1.9 clean" then "rake1.9 test" passes all the tests :)
I forgot to re-compile :)

Aaron Patterson

unread,
Oct 31, 2009, 1:28:33 PM10/31/09
to nokogi...@googlegroups.com

Ya, try with libxml2 2.7.6. That's the version I'm using.

Aaron Patterson

unread,
Oct 31, 2009, 1:29:41 PM10/31/09
to nokogi...@googlegroups.com

It could be that you need to upgrade libiconv as well. I'm running:

libiconv @1.13 textproc/libiconv

Iñaki Baz Castillo

unread,
Oct 31, 2009, 4:05:55 PM10/31/09
to nokogi...@googlegroups.com
2009/10/31 Aaron Patterson <aaron.p...@gmail.com>:

>> However, how is possible that the available gem version passes all the
>> tests on my system?
>
> It could be that you need to upgrade libiconv as well.  I'm running:
>
> libiconv                       @1.13           textproc/libiconv

I have no such package installed. In fact, in Debian Lenny there is a
dummy package called "libiconv-ruby" and installs nothing since it's
already included in libruby package.

Aaron Patterson

unread,
Oct 31, 2009, 4:12:19 PM10/31/09
to nokogi...@googlegroups.com

You must have libiconv somewhere. libxml2 needs to link against it.
I'm not familiar with debian packages, so it might be named something
different.

Reply all
Reply to author
Forward
0 new messages