Lars Bähren
2012-Aug-01 09:58 UTC
[webgen-users] comparison of Webgen::Tag::Menu::MenuNode with Webgen::Tag::Menu::MenuNode failed
Hello, since some while now I am in the process of migrating my older website (which is using Dokuwiki) to a Webgen-powered one. The major part of the contents is a blog, which by now has accumulated nine years written entries. While I am well prepared to have the rebuilding of the website from the sources take some time, there is one type of error I keep running into, which prevents me from completing the generation of site time and time again: ...done in 39.0825 seconds Updating tree... An error has occurred: Error while working on </blog/2007/2007-01/2007-01-14_11-08.en.html>: comparison of Webgen::Tag::Menu::MenuNode with Webgen::Tag::Menu::MenuNode failed Of course I already have been running some online search, but until now I have come up dry with hints to get to the bottom of this; by now I should have run webgen will all sorts of extra options to provide me with some output, which might help pinning down the problem - however all I am getting is the above error message. The file and its syntax are sound. Temporarily moving the source file out of the way will cause the error to be shifted to another file, which again is fine in terms of syntax. Any help or suggestions for further debugging would be appreciated. Cheers, Lars Baehren -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/webgen-users/attachments/20120801/1080cbf1/attachment.html>
Thomas Leitner
2012-Aug-01 12:49 UTC
[webgen-users] comparison of Webgen::Tag::Menu::MenuNode with Webgen::Tag::Menu::MenuNode failed
Hi, On 2012-08-01 02:58 -0700 Lars B?hren wrote:> ...done in 39.0825 seconds > Updating tree... > An error has occurred: > Error while working on > </blog/2007/2007-01/2007-01-14_11-08.en.html>: comparison of > Webgen::Tag::Menu::MenuNode with Webgen::Tag::Menu::MenuNode failed > > Of course I already have been running some online search, but until > now I have come up dry with hints to get to the bottom of this; by > now I should have run webgen will all sorts of extra options to > provide me with some output, which might help pinning down the > problem - however all I am getting is the above error message. The > file and its syntax are sound. Temporarily moving the source file out > of the way will cause the error to be shifted to another file, which > again is fine in terms of syntax.I haven''t really seen this error until now. You can enable more debugging by running webgen this way: ruby -d -S webgen -v -l 0 If this does not give you a hint where the error lies, maybe you can send me your sources (or a trimmed down version where the error still occurs) and send it to me, so that I can have a look at it! Best regards, Thomas
Lars Bähren
2012-Aug-08 08:24 UTC
[webgen-users] comparison of Webgen::Tag::Menu::MenuNode with Webgen::Tag::Menu::MenuNode failed
Thanks Thomas for the reply... and sorry for being somewhat slow following up on your suggestions. I ran Webgen in the way you suggested, leaving me with the impression that there might be something funny with my Ruby installation to begin with (I have to admit though that I am not too much of a Ruby expert yet to properly judge this): Exception `LoadError'' at /opt/local/lib/ruby/vendor_ruby/1.8/rubygems.rb:1113 - no such file to load -- rubygems/defaults/operating_system Exception `LoadError'' at /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/config_file.rb:50 - no such file to load -- Win32API Exception `NoMethodError'' at /opt/local/lib/ruby/1.8/rational.rb:78 - undefined method `gcd'' for Rational(1, 2):Rational Exception `TypeError'' at /opt/local/lib/ruby/gems/1.8/gems/webgen-0.5.14/lib/webgen/website.rb:335 - instance of IO needed Starting webgen... Updating tree... ...done in 5.3541 seconds Writing changed nodes... One the update of the tree has completed, the generation of the webpages starts: Writing changed nodes... /bg.gif Exception `Errno::EEXIST'' at /opt/local/lib/ruby/1.8/fileutils.rb:243 - File exists - /Users/lars/Sites/larsbaehren.com/release/website Exception `NoMethodError'' at /opt/local/lib/ruby/gems/1.8/gems/webgen-0.5.14/lib/webgen/node.rb:218 - undefined method `coerce'' for "Upcoming blog entries":String Exception `ArgumentError'' at /opt/local/lib/ruby/gems/1.8/gems/webgen-0.5.14/lib/webgen/tag/menu.rb:40 - comparison of Webgen::Tag::Menu::MenuNode with Webgen::Tag::Menu::MenuNode failed Exception `Webgen::RenderError'' at /opt/local/lib/ruby/gems/1.8/gems/webgen-0.5.14/lib/webgen/sourcehandler.rb:170 - comparison of Webgen::Tag::Menu::MenuNode with Webgen::Tag::Menu::MenuNode failed Exception `Webgen::RenderError'' at /opt/local/lib/ruby/gems/1.8/gems/webgen-0.5.14/lib/webgen/sourcehandler.rb:78 - comparison of Webgen::Tag::Menu::MenuNode with Webgen::Tag::Menu::MenuNode failed An error has occurred: Error while rendering </blog/2003.en.html>: comparison of Webgen::Tag::Menu::MenuNode with Webgen::Tag::Menu::MenuNode failed I do get the suspicion that effects from the first error messages trickle down the line, but I am not quite sure what to look for exactly. Best regards, Lars -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/webgen-users/attachments/20120808/2e4e9aa6/attachment.html>
Thomas Leitner
2012-Aug-08 10:08 UTC
[webgen-users] comparison of Webgen::Tag::Menu::MenuNode with Webgen::Tag::Menu::MenuNode failed
On 2012-08-08 01:24 -0700 Lars B?hren wrote:> Exception `LoadError'' at > /opt/local/lib/ruby/vendor_ruby/1.8/rubygems.rb:1113 - no such file > to load -- rubygems/defaults/operating_system > Exception `LoadError'' at > /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/config_file.rb:50 - no > such file to load -- Win32API > Exception `NoMethodError'' at /opt/local/lib/ruby/1.8/rational.rb:78 - > undefined method `gcd'' for Rational(1, 2):Rational > Exception `TypeError'' at > /opt/local/lib/ruby/gems/1.8/gems/webgen-0.5.14/lib/webgen/website.rb:335 > - instance of IO needed > Starting webgen... > Updating tree... > ...done in 5.3541 seconds > Writing changed nodes...All the above errors can be ignored. The first few errors come from Rubygems which tries to load optional libraries. The last one comes from webgen which tries to load the cache file and fails because no cache file exists.> One the update of the tree has completed, the generation of the > webpages starts: > > Writing changed nodes... > /bg.gif > Exception `Errno::EEXIST'' at /opt/local/lib/ruby/1.8/fileutils.rb:243 > - File exists - /Users/lars/Sites/larsbaehren.com/release/website > Exception `NoMethodError'' at > /opt/local/lib/ruby/gems/1.8/gems/webgen-0.5.14/lib/webgen/node.rb:218 > - undefined method `coerce'' for "Upcoming blog entries":String > Exception `ArgumentError'' at > /opt/local/lib/ruby/gems/1.8/gems/webgen-0.5.14/lib/webgen/tag/menu.rb:40 > - comparison of Webgen::Tag::Menu::MenuNode with > Webgen::Tag::Menu::MenuNode failed > Exception `Webgen::RenderError'' at > /opt/local/lib/ruby/gems/1.8/gems/webgen-0.5.14/lib/webgen/sourcehandler.rb:170 > - comparison of Webgen::Tag::Menu::MenuNode with > Webgen::Tag::Menu::MenuNode failed > Exception `Webgen::RenderError'' at > /opt/local/lib/ruby/gems/1.8/gems/webgen-0.5.14/lib/webgen/sourcehandler.rb:78 > - comparison of Webgen::Tag::Menu::MenuNode with > Webgen::Tag::Menu::MenuNode failed > An error has occurred: > Error while rendering </blog/2003.en.html>: > comparison of Webgen::Tag::Menu::MenuNode with > Webgen::Tag::Menu::MenuNode failed > > I do get the suspicion that effects from the first error messages > trickle down the line, but I am not quite sure what to look for > exactly.Hmm... this doesn''t really help me, too. Are you using any extensions that might cause this? It would definitely help if I could have a look at the source for your website. Best regards, Thomas
Lars Bähren
2012-Aug-08 10:20 UTC
[webgen-users] comparison of Webgen::Tag::Menu::MenuNode with Webgen::Tag::Menu::MenuNode failed
On Wednesday, August 8, 2012 12:08:01 PM UTC+2, Thomas Leitner wrote: All the above errors can be ignored. The first few errors come from> Rubygems which tries to load optional libraries. The last one comes > from webgen which tries to load the cache file and fails because no > cache file exists. >Ok, I was just a bit confused here; keeping in mind what you just mentioned however I am wondering why these events are considered to be errors and not simple warnings - but this is not the main issue here.> Hmm... this doesn''t really help me, too. Are you using any extensions > that might cause this? >No extensions used - I have been trying to keep things simple (at least for the time being). I will have to do something about a) the tags and b) the images at some later point, but at the moment I am focusing on pulling in the bulk of the contents.> It would definitely help if I could have a look at the source for your > website. >Will do. One option is to upload everything on Github, alternative is to create a tar-file with the main components (e.g. omitting the pictures). Cheers, Lars -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/webgen-users/attachments/20120808/429c1029/attachment-0001.html>
Lars Bähren
2012-Aug-08 10:38 UTC
[webgen-users] comparison of Webgen::Tag::Menu::MenuNode with Webgen::Tag::Menu::MenuNode failed
I am currently pushing the sources onto my Github account at https://github.com/lbaehren/Website; this might take a little while, since there are already quite a few files. Cheers, Lars -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/webgen-users/attachments/20120808/4fe76da0/attachment.html>
Thomas Leitner
2012-Aug-08 12:57 UTC
[webgen-users] comparison of Webgen::Tag::Menu::MenuNode with Webgen::Tag::Menu::MenuNode failed
On 2012-08-08 03:20 -0700 Lars B?hren wrote:> > On Wednesday, August 8, 2012 12:08:01 PM UTC+2, Thomas Leitner wrote: > > All the above errors can be ignored. The first few errors come from > > Rubygems which tries to load optional libraries. The last one comes > > from webgen which tries to load the cache file and fails because no > > cache file exists. > > > Ok, I was just a bit confused here; keeping in mind what you just > mentioned however I am wondering why these events are considered to > be errors and not simple warnings - but this is not the main issue > here.Exceptions of kind LoadError occur often because one just doesn''t know if a given library exists or not. And it would be error-prone to do something simliar to `require` just to find out if a library is on the path. It''s easier to just require the file and catch the exception. Also note that these exceptions are thrown but do not lead to the application shutting down, which means that there is some code in place to deal with these errors in an orderly manner.> > It would definitely help if I could have a look at the source for > > your website. > > > Will do. One option is to upload everything on Github, alternative is > to create a tar-file with the main components (e.g. omitting the > pictures).I have found the problem! :-) webgen assumes that the title meta information is a string but when setting the title at the top of a page file it may get stored as a number when only digits are present due to YAML (as in src/pages/blog/2004.page). This is no problem in most cases but when sorting pages via their title information, Ruby can''t compare an Integer to a String (therefore the error message with the missing `coerce` method). Two ways to solve the problem: 1. You ensure that you only have string titles by wrapping all title meta information values with quotation marks. 2. You add the following code to your ext/init.rb file: class ::Webgen::Node def <=>(other) self_so = (@meta_info[''sort_info''] && @meta_info[''sort_info''].to_s) || @meta_info[''title''].to_s || '''' other_so = (other[''sort_info''] && other[''sort_info''].to_s) || other[''title''].to_s || '''' if self_so !~ /\D/ && other_so !~ /\D/ self_so = self_so.to_i other_so = other_so.to_i end self_so <=> other_so end end After this change the website will be generated but there are some (fixable) problems with resolving paths (which may be due to the fact I did not use cmake as per your instructions to generate the website). Best regards, Thomas
Lars Bähren
2012-Aug-08 13:40 UTC
[webgen-users] comparison of Webgen::Tag::Menu::MenuNode with Webgen::Tag::Menu::MenuNode failed
On Wednesday, August 8, 2012 2:57:35 PM UTC+2, Thomas Leitner wrote:> I have found the problem! :-) webgen assumes that the title meta > information is a string but when setting the title at the top of a page > file it may get stored as a number when only digits are present due to > YAML (as in src/pages/blog/2004.page). >Thanks a bunch. Already fixed the meta information and everything (minus some warnings) is working once more.> This is no problem in most cases but when sorting pages via their title > information, Ruby can''t compare an Integer to a String (therefore the > error message with the missing `coerce` method). >Ok, I guess there is no internal conversion done, in order to enforce internal representation which can be compared.> Two ways to solve the problem: > > 1. You ensure that you only have string titles by wrapping all title > meta information values with quotation marks. > > 2. You add the following code to your ext/init.rb file: >I''ll keep the second option in mind; for the time being the simplest solution is to follow option 1, by adjusting my scripts to generate correct metadata. Thanks again. Cheers, Lars -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/webgen-users/attachments/20120808/7ed28299/attachment.html>