116 releases

new 0.9.119 Dec 4, 2025
0.9.117 Aug 1, 2025
0.9.116 Jun 2, 2025
0.9.111 Feb 28, 2025
0.9.28 Jul 28, 2022

#259 in Procedural macros

Download history 49031/week @ 2025-08-15 55141/week @ 2025-08-22 34239/week @ 2025-08-29 36574/week @ 2025-09-05 34537/week @ 2025-09-12 34808/week @ 2025-09-19 38365/week @ 2025-09-26 36204/week @ 2025-10-03 38661/week @ 2025-10-10 39158/week @ 2025-10-17 37515/week @ 2025-10-24 34450/week @ 2025-10-31 39442/week @ 2025-11-07 37942/week @ 2025-11-14 34997/week @ 2025-11-21 27870/week @ 2025-11-28

148,529 downloads per month
Used in 12 crates (via rb-sys)

MIT/Apache

74KB
2K SLoC

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.71+

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.

Dependencies

~5.5–7.5MB
~136K SLoC