Shopify/cibuildgem

Assist developers to distribute gems with precompiled binaries.

Ruby

77

250 commits

updated Sep 18, 2026

See the code

README

[!NOTE] This tool is currently in active development. We are very much looking for your feedback.

🗒️ Preamble

The problem this tool tries to solve.

A major bottleneck for every Ruby developers when running bundle install is the compilation of native gem extensions. To illustrate this issue, running bundle install on a new Rails application takes around 25 seconds on a MacBook Pro M4, and 80% of that time is spent compiling the couple dozens of gems having native extensions. It would take only 5 seconds if it wasn't for the compilation.

How we can solve this problem for the Ruby community.

The Python community had exactly the same issue and came up with the amazing cibuildwheel solution to provide a CI based compilation approach to help maintainers ship their libraries will precompiled binaries for various platforms.

This tool modestly tries to follow the same approach by helping ruby maintainers ship their gems with precompiled binaries.

Existing solutions.

Precompilation isn't new in the Ruby ecosystem and some maintainers have been releasing their gems with precompiled binaries to speedup the installation process since a while (e.g. nokogiri, grpc, karafka-rdkafka). One of the most popular tool that enables to precompile binaries for different platform is the great rake-compiler-dock toolchain. It uses a cross compilation approach by periodically building docker images for various platforms and spinning up containers to compile the binaries.

As noted by @flavorjones, this toolchain works great but it's complex and brittle compared to the more simple process of compiling on the target platform.

💻 cibuildgem

Head to the documentation Wiki to setup and configure cibuildgem for your gem.

Working examples

Here are some working examples on gem that have setup cibuildgem

Supported platforms/Ruby versions

MacOS IntelMacOS ARMWindows x64 UCRTLinux GNU x86_64Linux AARCH64
Ruby 3.1🟢🟢🟢🟢🟢
Ruby 3.2🟢🟢🟢🟢🟢
Ruby 3.3🟢🟢🟢🟢🟢
Ruby 3.4🟢🟢🟢🟢🟢
Ruby 4.0🟢🟢🟠 (not tested)🟢🟢
bundle
gems
native-extensions
ruby
rubygem

Contributors

Edouard-chin

239 commits

shopify-river

5 commits

rafaelfranca

2 commits

Shopify/cibuildgem

Assist developers to distribute gems with precompiled binaries.

Ruby

77

250 commits

updated Sep 18, 2026

See the code

README

[!NOTE] This tool is currently in active development. We are very much looking for your feedback.

🗒️ Preamble

The problem this tool tries to solve.

A major bottleneck for every Ruby developers when running bundle install is the compilation of native gem extensions. To illustrate this issue, running bundle install on a new Rails application takes around 25 seconds on a MacBook Pro M4, and 80% of that time is spent compiling the couple dozens of gems having native extensions. It would take only 5 seconds if it wasn't for the compilation.

How we can solve this problem for the Ruby community.

The Python community had exactly the same issue and came up with the amazing cibuildwheel solution to provide a CI based compilation approach to help maintainers ship their libraries will precompiled binaries for various platforms.

This tool modestly tries to follow the same approach by helping ruby maintainers ship their gems with precompiled binaries.

Existing solutions.

Precompilation isn't new in the Ruby ecosystem and some maintainers have been releasing their gems with precompiled binaries to speedup the installation process since a while (e.g. nokogiri, grpc, karafka-rdkafka). One of the most popular tool that enables to precompile binaries for different platform is the great rake-compiler-dock toolchain. It uses a cross compilation approach by periodically building docker images for various platforms and spinning up containers to compile the binaries.

As noted by @flavorjones, this toolchain works great but it's complex and brittle compared to the more simple process of compiling on the target platform.

💻 cibuildgem

Head to the documentation Wiki to setup and configure cibuildgem for your gem.

Working examples

Here are some working examples on gem that have setup cibuildgem

Supported platforms/Ruby versions

MacOS IntelMacOS ARMWindows x64 UCRTLinux GNU x86_64Linux AARCH64
Ruby 3.1🟢🟢🟢🟢🟢
Ruby 3.2🟢🟢🟢🟢🟢
Ruby 3.3🟢🟢🟢🟢🟢
Ruby 3.4🟢🟢🟢🟢🟢
Ruby 4.0🟢🟢🟠 (not tested)🟢🟢
bundle
gems
native-extensions
ruby
rubygem

Contributors

Edouard-chin

239 commits

shopify-river

5 commits

rafaelfranca

2 commits

Languages

Ruby

99.6%