https://github.com/oxidize-rb/rb-sys
Easily build Ruby native extensions in Rust
https://github.com/oxidize-rb/rb-sys
native-extensions ruby ruby-extension rubygem rust
Last synced: 6 months ago
JSON representation
Easily build Ruby native extensions in Rust
- Host: GitHub
- URL: https://github.com/oxidize-rb/rb-sys
- Owner: oxidize-rb
- License: apache-2.0
- Created: 2021-12-21T02:20:54.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2025-07-13T18:13:43.000Z (6 months ago)
- Last Synced: 2025-07-13T18:39:12.985Z (6 months ago)
- Topics: native-extensions, ruby, ruby-extension, rubygem, rust
- Language: Rust
- Homepage: https://oxidize-rb.github.io/rb-sys/
- Size: 5.66 MB
- Stars: 262
- Watchers: 7
- Forks: 45
- Open Issues: 48
-
Metadata Files:
- Readme: readme.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# rb-sys
[](https://github.com/oxidize-rb/rb-sys/actions/workflows/ci.yml)
[](https://join.slack.com/t/oxidize-rb/shared_invite/zt-16zv5tqte-Vi7WfzxCesdo2TqF_RYBCw)
 
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](https://oxidize-rb.github.io/rb-sys/), 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](https://github.com/oxidize-rb/oxi-test) - Canonical example of rb-sys usage (minimal, tested,
cross-compiled)
- [blake3-ruby](https://github.com/oxidize-rb/blake3-ruby) - Fast cryptographic hash function
- [wasmtime-rb](https://github.com/bytecodealliance/wasmtime-rb) - WebAssembly runtime with rb-sys and Magnus
- [lz4-ruby](https://github.com/yoshoku/lz4-ruby) - LZ4 compression library
## Getting Help
- Join the [Oxidize Ruby Slack](https://join.slack.com/t/oxidize-rb/shared_invite/zt-16zv5tqte-Vi7WfzxCesdo2TqF_RYBCw)
and post in the `#general` channel
- [Open an issue](https://github.com/oxidize-rb/rb-sys/issues) on GitHub
## Contributing
See the [CONTRIBUTING.md](./CONTRIBUTING.md) file for information about setting up a development environment.
## License
Licensed under either of:
- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE))
- MIT license ([LICENSE-MIT](LICENSE-MIT))
at your option.