Project

rb_sys

0.54
There's a lot of open issues
A long-lived project that still receives updates
Helpers for compiling Rust extensions for ruby
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Runtime

 Project Readme

rb-sys

.github/workflows/ci.yml Join the discussion Crates.io Gem

The primary goal of rb-sys is to make building native Ruby extensions in Rust easier than it would be in C. If it's not easy, it's a bug.

Documentation

For comprehensive documentation, please refer to the Ruby on Rust Book, which covers:

  • Getting started and quick start tutorials
  • Working with Ruby objects, classes, and modules
  • Memory management and safety
  • Cross-platform development
  • Testing and debugging
  • API reference for rb-sys crate and rb_sys gem

Components

  • rb-sys crate: Battle-tested Rust bindings for the Ruby C API
  • rb_sys gem: Simplifies compiling Rust code into Ruby extensions
  • rb-sys-test-helpers: Utilities for testing Ruby extensions from Rust
  • rb-sys-dock: Docker-based cross-compilation tooling

Supported Toolchains

  • Ruby: 2.6+
  • Rust: 1.65+

Real-World Examples

  • oxi-test - Canonical example of rb-sys usage (minimal, tested, cross-compiled)
  • blake3-ruby - Fast cryptographic hash function
  • wasmtime-rb - WebAssembly runtime with rb-sys and Magnus
  • lz4-ruby - LZ4 compression library

Getting Help

Contributing

See the CONTRIBUTING.md file for information about setting up a development environment.

License

Licensed under either of:

at your option.