use rb_class_new_instance() instead of rb_funcall() with rb_intern("new").