+0
Daily
5,624
stars
863
forks
219
watchers
5,765
prs
2,018
issues
0
releases
README
mruby
Table of contents
- What is mruby
- How to get mruby
- mruby homepage
- Mailing list
- How to compile, test, and install (mruby and gems)
- Amalgamation (single-file build)
- Building documentation
- How to customize mruby (mrbgems)
- Index of Document
- License
- Note for License
- How to Contribute
- Contributors
What is mruby
mruby is the lightweight implementation of the Ruby language complying to (part
of) the [ISO standard][ISO-standard] with more recent features provided by Ruby 4.x.
Also, its syntax is Ruby 4.x compatible.
You can link and embed mruby within your application. The "mruby" interpreter
program and the interactive "mirb" shell are provided as examples. You can also
compile Ruby programs into compiled byte code using the "mrbc" compiler. All
these tools are located in the "bin" directory. "mrbc" can also generate
compiled byte code in a C source file. See the "mrbtest" program under the
"test" directory for an example.
This achievement was sponsored by the Regional Innovation Creation R&D Programs
of the Ministry of Economy, Trade and Industry of Japan.
How to get mruby
To get mruby, you can download a release from the official mruby GitHub
repository or clone the trunk of the mruby source tree with the "git clone"
command. You can also install and compile mruby using ruby-install, ruby-build, rvm, conda or Homebrew.
Releases, including release candidates, are published on the releases page:
https://github.com/mruby/mruby/releases.
Download the mruby-.tar.gz, .tar.xz or .zip attached to a
release. The "Source code" archives GitHub generates for a tag, and the ZIP
of the master branch, leave out the Prism parser that mruby-compiler carries
as a git submodule, so they do not build.
The trunk of the mruby source tree can be checked out with the following
command; the --recursive fetches that submodule as well:
console
$ git clone --recursive https://github.com/mruby/mruby.git
In a clone made without it, rake fetches the submodule on the first build.
mruby homepage
The URL of the mruby homepage is: .
Mailing list
We don't have a mailing list, but you can use GitHub issues.
How to compile, test, and install (mruby and gems)
For the simplest case, type
console
rake all test
See the compile.md file for the detail.
Amalgamation (single-file build)
mruby supports amalgamation, which combines all source files into a single
mruby.c and mruby.h for easy embedding (similar to SQLite).
console
rake amalgam
Output files are generated in build/host/amalgam/. To use:
console
gcc -I./build/host/amalgam your_app.c ./build/host/amalgam/mruby.c -o your_app -lm
Building documentation
There are two sets of documentation in mruby: the mruby API (generated by YARD) and C API (Doxygen and Graphviz)
To build both of them, simply go
console
rake doc
You can also view them in your browser
console
rake view_api
rake view_capi
How to customize mruby (mrbgems)
mruby contains a package manager Discussions
#7669A 3D engine using mruby2 comments · 2026-10-12#6900A community SSH service for mruby developers2 comments · 2026-06-19#6897mruby-lsp0 comments · 2026-06-18#6880Get bytecode after compilation from `mrb_parse_file`1 comments · 2026-06-07#6710Get mrb_syms for nested classes0 comments · 2026-01-25#6686Backpack Ruby - MRuby-based toolchain for tool-poor environments0 comments · 2025-12-16#6626Explicitly disabling libreadline or choosing an alternative2 comments · 2025-09-18#6496Wrapping a nested struct1 comments · 2025-03-24