[webgen-users] Use RbConfig instead of obsolete and deprecated Config

2742 views
Skip to first unread message

Damien Robert

unread,
Nov 25, 2011, 7:37:50 AM11/25/11
to webgen...@rubyforge.org
Hi everyone,

since my last gem update, I get the following error when using webgen:

/home/dams/opt/ruby/gems/webgen-0.5.14/lib/webgen/cli/utils.rb:10: Use
RbConfig instead of obsolete and deprecated Config.
/usr/lib/ruby/1.9.1/psych.rb:154:in `parse': (<unknown>): couldn't parse
YAML at line 21 column 9 (Psych::SyntaxError)
from /usr/libb/ruby/1.9.1/psych.rb:154:in `parse_stream'
from /usr/lib/ruby/1.9.1/psych.rb:125:in `parse'
from /usr/lib/ruby/1.9.1/psych.rb:112:in `load'loadfrom
/home/dams/opt/ruby/gems/webgen-0.5.14/lib/webgen/website.rb:358:in
`read_config_file'
from /home/dams/opt/ruby/gems/webgen-0.5.14/lib//webgen/website.rb:258:in
`block in init'
from /home/dams/opt/ruby/gems/s/webgen-0.5.14/lib/webgen/website.rb:316:in
`execute_in_env'
from /home/me/dams/opt/ruby/gems/webgen-0.5.14/lib/webgen/website.rb:252:in
`init'
from /home/dams/opt/ruby/gems/webgen-0.5.14/lib/webgen/website.rb:271:in
`blockk in render'
from /home/dams/opt/ruby/gems/webgen-0.5.14/lib/webgen/webbsite.rb:316:in
`execute_in_env'
from /home/dams/opt/ruby/gems/webgen-0.5.14/lib/webgen/website.rb:270:in
`render'
from
/home/dams/opt/ruby/gems/webgen-0.5.14/lib/webgen/cli/run_command.rb:17:in
`execute'
from /home/dams/opt/ruby/gems/cmdparse-2.0.3/lib/cmdparse.rb:436:in
`parse'
from /home/dams/opt/ruby/gems/webgen-0.5.14/lib/webgen/cli.rb:125:in
`parse'
from /home/dams/opt/ruby/gems/webgen-0.5.14/bin/webgen:6:in `<top
(required)>'
from /home/dams/opt/ruby/bin/webgen:19:in `load'
from /home/dams/opt/ruby/bin/in/webgen:19:in `<main>'

I did not change my yaml config files, so it seems like the upgrade of one
of the gem broke webgen. Does anyone else has the same problem? Do you know
a solution?

_______________________________________________
webgen-users mailing list
webgen...@rubyforge.org
http://rubyforge.org/mailman/listinfo/webgen-users

Thomas Leitner

unread,
Nov 27, 2011, 1:41:10 AM11/27/11
to webgen...@rubyforge.org
On 2011-11-25 13:37 +0100 Damien Robert wrote:
> I did not change my yaml config files, so it seems like the upgrade
> of one of the gem broke webgen. Does anyone else has the same
> problem? Do you know a solution?

It seems that you are using webgen with Ruby 1.9 which is currently not
really supported! There are some changes in Ruby 1.9, especially the
change from the syck YAML library to the psych YAML library, which may
cause errors. So please use Ruby 1.8 for the time being!

Best regards,
Thomas

Johann Friedrich Heinrichmeyer

unread,
Feb 3, 2012, 6:14:33 AM2/3/12
to webgen...@googlegroups.com, webgen...@rubyforge.org
With ruby 1.9.3 some strings containing colons or double colons puzzle the yaml parser. Some strings need quoting, i.e.

output: ["Webgen::Output::FileSystem",  out]

works again (you have to quote expressions containing :: )

Johann Friedrich Heinrichmeyer

unread,
Feb 3, 2012, 6:17:17 AM2/3/12
to webgen...@googlegroups.com, webgen...@rubyforge.org
PS: still no way with webgen and jruby, but that is another story

Johann Friedrich Heinrichmeyer

unread,
Feb 3, 2012, 6:45:00 AM2/3/12
to webgen...@googlegroups.com, webgen...@rubyforge.org
PS2: a little tedious, no more brackets with lists that have symbols as key, the following works again:

output_path_style:
       - :parent
       - :basename
       - ".xml"

here quoting would change the type from symbol to string

Johann Friedrich Heinrichmeyer

unread,
Feb 3, 2012, 6:54:34 AM2/3/12
to webgen...@googlegroups.com, webgen...@rubyforge.org
In the end, "real" yaml is not ruby friendly ;-)

Thomas Leitner

unread,
Feb 3, 2012, 11:34:36 AM2/3/12
to webgen...@rubyforge.org
On 2012-02-03 03:54 -0800 Johann Friedrich Heinrichmeyer wrote:
> In the end, "real" yaml is not ruby friendly ;-)

The problem lies in the new YAML library, psych, that is used by
default on Ruby 1.9.2 and onwards. It is based on libyaml, a newer YAML
implementation. The old Ruby YAML library is named syck, btw.

Due to psych being libyaml based, this error also occurs in all other
programming languages that use libyaml for YAML parsing (e.g. python).

This problem is officially recognized, see [1].

You can work around this problem by running

export RUBYOPT="-rsyck"

before running webgen. This ensures that the "old" library is used
instead of the new one and should solve most YAML related problems.

Best regards,
Thomas

[1]: http://bugs.ruby-lang.org/issues/4479

Reply all
Reply to author
Forward
0 new messages