# How does gem deal with extensions?

**URL:** <https://www.ruby-forum.com/t/how-does-gem-deal-with-extensions/130703>\
**Category:** Ruby\
**Created:** [March 2, 2008, 5:33am UTC](https://www.ruby-forum.com/t/how-does-gem-deal-with-extensions/130703 "2008-03-02T05:33:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chiyuan\_Z](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/9e8a1a/32.png) [@Chiyuan\_Z](https://www.ruby-forum.com/u/Chiyuan_Z)\
**Post date:** [March 2, 2008, 5:33am UTC](https://www.ruby-forum.com/t/how-does-gem-deal-with-extensions/130703/1 "2008-03-02T05:33:45Z")

</div>

Hi, all!

I’m building a gem that contains some C extensions. Here’s  
the directory hierarchy:

lib/  
rmmseg.rb  
rmmseg/  
foo.rb  
bar.rb  
ext/  
rmmseg/  
extconf.rb  
ext.c

After installing the gem. The ext.so get built in ext/rmmseg/ . It is OK  
since the require path contains ext. I can require it using  
‘rmmseg/ext’.  
However, I found the ext.so also gets copied to lib/ directory. What’s  
the  
purpose? Can I disable this? Thanks!
