From: ddungum@... Date: 2008-09-19T20:17:16+09:00 Subject: rb_include_module() doesn't call Module#included I'm writing a c extension and I want to create a class called "World" in C which includes a ruby module "Serializable". # autoexec.rb module Serializable def self.included( otherMod ) puts "Serializable is included by #{otherMod.name}" end end // World.c ... rb_load( rb_str_new2("autoexec.rb"), 0 ); VALUE klass = rb_define_class("World", rb_cObject); rb_include_module( klass, rb_eval_string("Serializable") ); # in IRB >> require "World.so" => true >> World.included_modules => [Serializable, Kernel] As you can see, class "World" includes module "Serializable", but Serializable#included is not called. I saw rb_mod_include (not rb_include_module) calls Module#included explicitly in eval.c, but it's declared as a static function, so I can't use it in my source code. I think this problem is a bug, but how do you think ? By the way, if I replace rb_include_module call with this, Module#included is called fortunately. VALUE args [1] = { rb_str_new2("include Serializable") }; rb_mod_module_eval( 1, args, klass ); But I don't want to use eval function because it's relatively slow.