Creating a multiplatform Gem

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!!

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.

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.