From: Kristof Bastiaensen Date: 2004-04-29T01:19:01+09:00 Subject: Re: Learning extending ruby Hi, On Wed, 28 Apr 2004 08:44:18 -0700, Dominik Werder wrote: > rb_define_attr(str, "myvar", 1, 1); # <------- PROBLEM! The attr methods work on the class, not on the instance. So try this instead (from Init_cRubyTest): rb_define_attr(cRubyTest, "myvar", 1, 1); Kristof