A high performance implementation of the Ruby programming language. Built on the GraalVM by Oracle Labs.
There are three ways to install TruffleRuby releases and nightly builds:
bin/rubycommand that runs TruffleRuby. We recommend that you use a Ruby manager to use TruffleRuby inside GraalVM.
Via your Ruby manager/installer (RVM, rbenv, chruby, ruby-build, ruby-install). This contains only TruffleRuby, in the Native configuration, making it a smaller download. It is meant for users who only want a Ruby implementation and are already using a Ruby manager.
Via the standalone distribution as a simple binary tarball.
We recommend trying TruffleRuby nightly builds which contain the latest fixes and improvements:
RVM: $ rvm install truffleruby-head rbenv: $ rbenv install truffleruby-dev chruby: $ ruby-build truffleruby-dev ~/.rubies/truffleruby-dev
See the Ruby installers documentation for more details.
Testing TruffleRuby in CI is easy. On TravisCI, you can use:
language: ruby rvm: - truffleruby # or truffleruby-head
And on GitHub Actions:
- uses: ruby/[email protected] with: ruby-version: truffleruby # or truffleruby-head
See Testing TruffleRuby in CI for more details and other CIs.
You can use
bundleto install gems, as usual.
Please report any issues you might find on GitHub.
TruffleRuby aims to:
There are two main runtime configurations of TruffleRuby, Native and JVM, which have different trade-offs.
| Configuration: | Native (
--native, default) | JVM (
--jvm) | | ------------------ | ------------: | ------------: | | Time to start TruffleRuby | about as fast as MRI startup | slower | | Time to reach peak performance | faster | slower | | Peak performance (also considering GC) | good | best | | Java host interoperability | needs reflection configuration | just works |
To find out which runtime configuration is being used, run
ruby --versionon the command line, or check the value of
TruffleRuby.native?in Ruby code. Runtime configurations are further detailed in Deploying TruffleRuby.
TruffleRuby is actively tested on the following systems:
arm64): Experimental, C extensions do not work yet on AArch64
You may find that TruffleRuby will not work if you severely restrict the environment, for example, by unmounting system filesystems such as
Without these dependencies, many libraries including RubyGems will not work. TruffleRuby will try to print a nice error message if a dependency is missing, but this can only be done on a best effort basis.
You may also need to set up a UTF-8 locale.
See the contributor workflow document if you wish to build TruffleRuby from source.
We recommend that people trying TruffleRuby on their gems and applications get in touch with us for help.
TruffleRuby can run Rails and is compatible with many gems, including C extensions. However, TruffleRuby is not 100% compatible with MRI 2.7 yet. Please report any compatibility issues you might find. TruffleRuby passes around 97% of ruby/spec, more than any other alternative Ruby implementation.
TruffleRuby might not be fast yet on Rails applications and large programs. Notably, large programs currently take a long time to warmup on TruffleRuby and this is something the TruffleRuby team is currently working on. Large programs often involve more performance-critical code so there is a higher chance of hitting an area of TruffleRuby which has not been optimized yet.
TruffleRuby has the same version, and is released at the same time as GraalVM. There is a release every 3 months. See the release roadmap.
TruffleRuby should in most cases work as a drop-in replacement for MRI, but you should read about our compatibility.
For many use cases TruffleRuby should work as a drop-in replacement for JRuby. However, our approach to integration with Java is different to JRuby so you should read our migration guide.
The best way to get in touch with us is to join the
#trufflerubychannel on GraalVM Slack. You can also Tweet to @TruffleRuby, or email [email protected].
Please report security vulnerabilities via the process outlined in the reporting vulnerabilities guide, rather than by something public such as a GitHub issue or a Gitter conversation.
Announcements about GraalVM, including TruffleRuby, are made on the graal-dev mailing list.
The main authors of TruffleRuby ordered by first contribution are: Chris Seaton, Benoit Daloze, Kevin Menard, Petr Chalupa, Brandon Fish, Duncan MacGregor, Christian Wirth, Rafael França, Alan Wu, Nicolas Laurent, Carol Chen, Nikolay Sverchkov, and Lillian Zhang.
TruffleRuby is copyright (c) 2013-2021 Oracle and/or its affiliates, and is made available to you under the terms of any one of the following three licenses: