Ubuntu + Ruby == undefined `type_tag' for YAML:Module

Rubies:

The good news is I got a new Ubuntu. Wu hu!

The bad news is its ruby*.deb package is very needy. It did not have
test/unit, for example. I removed it, installed gcc, and compiled
ruby-1.8.3

Then everything works but YAML breaks on this line:

/usr/local/lib/ruby/1.8/yaml.rb:314:in `add_ruby_type': undefined local
variable or method `type_tag' for YAML:Module (NameError)

That line is the very next feature I was trying to add to my project (a
new YAML type), so I'm a little disgruntled that so fine a system broke
in just the one little corner that I was working on!

If anyone knows a fix feel free to reply. I will reply if I find one.
Otherwise this post will serve to transmit this issue to the Great
Issue Database in the Sky...

···

--
  Phlip

I'm still using Hoary on my box at home, but test/unit is in another
package, as is most (all) of the standard library. ri and irb are
separate packages, too. I can't remember the name (something like
libruby-test), but you can find it if you do some apt-cache searching.

···

On 11/10/05, Phlip <phlip2005@gmail.com> wrote:

The bad news is its ruby*.deb package is very needy. It did not have
test/unit, for example. I removed it, installed gcc, and compiled
ruby-1.8.3

--
Rob

The bad news is its ruby*.deb package is very needy. It did not have
test/unit, for example. I removed it, installed gcc, and compiled
ruby-1.8.3

Perhaps best to install 1.8.4

/usr/local/lib/ruby/1.8/yaml.rb:314:in `add_ruby_type': undefined local
variable or method `type_tag' for YAML:Module (NameError)

Probably a typo in ::add_ruby_type

def YAML.add_ruby_type( type, &transfer_proc )
     resolver.add_type( "tag:ruby.yaml.org,2002:#{ type_tag }", transfer_proc )
end

replace `(type,' with `(type_tag,'

Guy Decoux

ts wrote:

Perhaps best to install 1.8.4

The reason has probably floated through here recently. Apologies for
not reading up; what's the first reason to move up?

Probably a typo in ::add_ruby_type

Got that. Then I Googled for the new style in add_*_type, and threw
that in.

Then I switched to add_builtin_type because I'm evil. I added a type
that everyone will like. need. get hooked on. sell their relatives for.

Wait for it. You'l see!

···

--
  Phlip
  greencheese.org

The reason has probably floated through here recently. Apologies for
not reading up; what's the first reason to move up?

With bison < 2.0, alloca() was used for the parser stack : ruby knew
this and it was optimized.

This was changed with bison 2.0 (it use alloc() now) this means that the
GC for 1.8.3 can't work with bison 2.0 and Unbuntu breezy came with bison
2.0

The GC for 1.8.4 was modified for this new behaviour.

Guy Decoux

ts wrote:

This was changed with bison 2.0 (it use alloc() now) this means that the
GC for 1.8.3 can't work with bison 2.0 and Unbuntu breezy came with bison
2.0

The GC for 1.8.4 was modified for this new behaviour.

Wow, thanks! That's completely almost Ubuntu-specific, _and_ it won't affect
portability!

Those of us who don't know are wondering where insiders get 1.8.4. It ain't
on http://www.ruby-lang.org/en/20020102.html . I will go with
stable-snapshot until advised.

···

--
  Phlip
  greencheese.org <-- NOT a blog!!!

Phlip ha scritto:

Those of us who don't know are wondering where insiders get 1.8.4. It ain't on http://www.ruby-lang.org/en/20020102.html . I will go with stable-snapshot until advised.

I supposed that was the same that 1.8.4preview1, but it seems stable-snapshot is a different thing from
ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.4-preview1.tar.gz