# Require gem within c extension

**URL:** <https://rubytalk.org/t/require-gem-within-c-extension/26508>\
**Category:** ruby-talk\
**Created:** [7 April 2006 20:11 UTC](https://rubytalk.org/t/require-gem-within-c-extension/26508 "2006-04-07T20:11:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dave\_Lee2](https://avatars.discourse-cdn.com/v4/letter/d/3d9bf3/32.png) [@Dave\_Lee2](https://rubytalk.org/u/Dave_Lee2)\
**Post date:** [7 April 2006 20:11 UTC](https://rubytalk.org/t/require-gem-within-c-extension/26508/1 "2006-04-07T20:11:12Z")

</div>

Hi,

I have an Init\_extension() function which includes the following line:

rb\_funcall(rb\_mKernel, rb\_intern("require"), 1, rb\_str\_new2("arrayfields"));

The reason for not using rb\_require() in this case is because it's not  
gem aware. The problem I'm experiencing is that execution is  
returning from Init\_extension() upon trying to call require in this  
way. The code after this rb\_funcall() invocation is not being  
executed.

I figured I'd ask here before having to dissect the call sequence from  
rb\_funcall().

thanks,  
Dave
