# Creating a multiplatform Gem

**URL:** <https://www.ruby-forum.com/t/creating-a-multiplatform-gem/171993>\
**Category:** Ruby\
**Created:** [July 13, 2009, 5:47am UTC](https://www.ruby-forum.com/t/creating-a-multiplatform-gem/171993 "2009-07-13T05:47:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ychacon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/71c47a/32.png) [@ychacon](https://www.ruby-forum.com/u/ychacon)\
**Post date:** [July 13, 2009, 5:47am UTC](https://www.ruby-forum.com/t/creating-a-multiplatform-gem/171993/1 "2009-07-13T05:47:33Z")

</div>

Hi!!

I would like to create a multi-platform gem, but i don’t know if there  
is a way to do that. I probably could do a gem for each OS, but i want  
to know if there is a way to only build one gem that can be use in  
different OSs.

The gem not only contains ruby code, i’m using extensions written in C.

I really hope you can answer me!

Thanks!!

---

<div class="post-metadata">

**Author:** ![ychacon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/71c47a/32.png) [@ychacon](https://www.ruby-forum.com/u/ychacon)\
**Post date:** [July 13, 2009, 7:35am UTC](https://www.ruby-forum.com/t/creating-a-multiplatform-gem/171993/2 "2009-07-13T07:35:26Z")

</div>

Yennifer Chacon wrote:

> I would like to create a multi-platform gem, but i don’t know if there  
> is a way to do that. I probably could do a gem for each OS, but i want  
> to know if there is a way to only build one gem that can be use in  
> different OSs.

you dont specify a os in the gemspec.

that should work.

---

<div class="post-metadata">

**Author:** ![ychacon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/71c47a/32.png) [@ychacon](https://www.ruby-forum.com/u/ychacon)\
**Post date:** [July 13, 2009, 2:05pm UTC](https://www.ruby-forum.com/t/creating-a-multiplatform-gem/171993/3 "2009-07-13T14:05:02Z")

</div>

Yennifer Chacon wrote:

> Hi!!
> 
> I would like to create a multi-platform gem, but i don’t know if there  
> is a way to do that. I probably could do a gem for each OS, but i want  
> to know if there is a way to only build one gem that can be use in  
> different OSs.

Typically you publish the source code for your gem, then the source code  
is built by the compiler when they run “gem install x”

however, it is possible to release a gem with compiled code, too. The  
closest thing to your request currently is there is a helper for  
building binaries for windows. [1]

Cheers!  
=r  
[1] [GitHub - rake-compiler/rake-compiler: Provide a standard and simplified way to build and package Ruby C and Java extensions using Rake as glue.](http://github.com/luislavena/rake-compiler/tree/master)
