# \[BUG\] type\_register and ruby 1.9

**URL:** <https://www.ruby-forum.com/t/bug-type-register-and-ruby-1-9/177008>\
**Category:** Ruby-Gnome 2\
**Created:** [October 9, 2009, 5:48pm UTC](https://www.ruby-forum.com/t/bug-type-register-and-ruby-1-9/177008 "2009-10-09T17:48:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mazwak](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e9c0ed/32.png) [@mazwak](https://www.ruby-forum.com/u/mazwak)\
**Post date:** [October 9, 2009, 5:48pm UTC](https://www.ruby-forum.com/t/bug-type-register-and-ruby-1-9/177008/1 "2009-10-09T17:48:26Z")

</div>

Hi, there seems to be a bug when using type\_register with ruby 1.9 :

sarnaud@NNAN0022:~/src/ruby-gnome2-all-0.19.3/gtk/sample/misc$ ruby -v  
ruby 1.9.1p243 (2009-07-16 revision 24175) [x86\_64-linux]  
sarnaud@NNAN0022:~/src/ruby-gnome2-all-0.19.3/gtk/sample/misc$ ruby  
properties.rb  
properties.rb:22:in `each': can't convert String into Integer (TypeError) from properties.rb:22:in`each\_with\_index’  
from properties.rb:22:in `initialize' from properties.rb:22:in`initialize’  
from properties.rb:69:in `new' from properties.rb:69:in`’

while it works ok with 1.8 :

sarnaud@NNAN0022:~/src/ruby-gnome2-all-0.19.3/gtk/sample/misc$ ruby -v  
ruby 1.8.7 (2009-06-12 patchlevel 174) [x86\_64-linux]  
sarnaud@NNAN0022:~/src/ruby-gnome2-all-0.19.3/gtk/sample/misc$ ruby  
properties.rb  
#\<MyButton:0x7f44d8c32660 ptr=0x1b72820\>  
“Hello”  
GLib::Type[“MyButton”]  
…  
…  
[MyButton, MyButton::RubyGtkContainerHook\_\_, Gtk::Button,  
#Module:0x7f44dbb9f358, Gtk::Bin, Gtk::Container, Gtk::Widget,  
Gtk::Buildable, Atk::Implementor, GLib::Interface, Gtk::Object,  
GLib::InitiallyUnowned, GLib::Object, GLib::Instantiatable, Object,  
Kernel]

Moreover, the error message does not really points at the right place.  
It always report the line which is calling ‘super’.

regards

Simon

---

<div class="post-metadata">

**Author:** ![mazwak](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e9c0ed/32.png) [@mazwak](https://www.ruby-forum.com/u/mazwak)\
**Post date:** [October 11, 2009, 7:22am UTC](https://www.ruby-forum.com/t/bug-type-register-and-ruby-1-9/177008/2 "2009-10-11T07:22:40Z")

</div>

Hi,

In [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
“[ruby-gnome2-devel-en] [BUG] type\_register and ruby 1.9” on Fri, 9  
Oct 2009 17:48:26 +0200,  
Simon A. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> from properties.rb:22:in `initialize' from properties.rb:69:in `new’  
> from properties.rb:69:in `’

Thanks for reporting.  
I’ve fixed it in trunk.

–  
kou
