Skip to content
A high performance implementation of the Ruby programming language. Built on the GraalVM by Oracle Labs.
Ruby Java C Yacc Jsonnet Shell
Branch: master
Clone or download
Latest commit 9bab53a Sep 17, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
bench Add a fixed-workload harness for OptCarrot with minimal dependencies Jul 18, 2019
bin Update bin Mar 10, 2019
doc update contact on Sep 17, 2019
lib Avoid mark deoptimisations. Sep 12, 2019
logo Add file with attribution details for CC Mar 20, 2017
mx.truffleruby Add necessary module info for the TRUFFLERUBY-SERVICES scriptengine Sep 17, 2019
spec Remove no longer used darwinCI tags Sep 9, 2019
src [GR-18280] Add boundary which seems needed on JDK11 Sep 17, 2019
test unset cache_path if not gem test pack Sep 3, 2019
tool Do not use the @generated annotation since it is no longer available … Sep 17, 2019
.gitattributes Fixups following the move from lib/ruby/gems/2.6.0 to lib/gems Jul 9, 2019
.gitignore Ignore eclipse workspace files Sep 14, 2019
.reek.yml Document how to run static analysis tools Jan 25, 2019
.rubocop.yml Move the RubyTCKLanguageProvider to its own distribution Aug 23, 2019
.ruby-version Update to Ruby 2.6.2 Mar 14, 2019
3rd_party_licenses.txt Use a second source directory instead of a separate project for the c… Jun 4, 2019 [GR-17791] Implement rb_str_drop_bytes. Aug 26, 2019 Add build instructions to Apr 24, 2019 Update licenses Feb 2, 2019 update contact on Sep 17, 2019
ci.jsonnet [GR-18160] CI: Bump the timeout for the ruby-test-specs-darwin gate Sep 10, 2019
utils.libsonnet Fix sulong vs graal and svm ordering and ensure it remains that way Mar 8, 2018
versions.json Update to Ruby 2.6.2 Mar 14, 2019

TruffleRuby logo

TruffleRuby is the GraalVM high-performance implementation of the Ruby programming language built by Oracle Labs.

Getting started

There are three ways to install TruffleRuby:

  • Via GraalVM, which includes support for other languages such as JavaScript, R and Python and supports both the native and JVM configurations. Inside GraalVM will then be a bin/ruby command 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 just wanting a Ruby implementation and already using a Ruby manager.

  • Using the standalone distribution as a simple binary tarball. This distribution is also useful for testing TruffleRuby in CI. On TravisCI, you can simply use:

    language: ruby
      - truffleruby

You can use gem to install Gems as normal.

Please report any issue you might find on GitHub.


TruffleRuby aims to:

  • Run idiomatic Ruby code faster
  • Run Ruby code in parallel
  • Boot Ruby applications in less time
  • Execute C extensions in a managed environment
  • Add fast and low-overhead interoperability with languages like Java, JavaScript, Python and R
  • Provide new tooling such as debuggers and monitoring
  • All while maintaining very high compatibility with the standard implementation of Ruby

TruffleRuby configurations

There are two main configurations of TruffleRuby: native and JVM. It's important to understand the different configurations of TruffleRuby, as each has different capabilities and performance characteristics. You should pick the execution mode that is appropriate for your application.

TruffleRuby by default runs in the native configuration. In this configuration, TruffleRuby is ahead-of-time compiled to a standalone native executable. This means that you don't need a JVM installed on your system to use it. The advantage of the native configuration is that it starts about as fast as MRI, it may use less memory, and it becomes fast in less time. The disadvantage of the native configuration is that you can't use Java tools like VisualVM, you can't use Java interoperability, and peak performance may be lower than on the JVM. The native configuration is used by default, but you can also request it using --native. To use polyglot programming with the native configuration, you need to use the --polyglot flag. To check you are using the native configuration, ruby --version should mention Native.

TruffleRuby can also be used in the JVM configuration, where it runs as a normal Java application on the JVM, as any other Java application would. The advantage of the JVM configuration is that you can use Java interoperability, and peak performance may be higher than the native configuration. The disadvantage of the JVM configuration is that it takes much longer to start and to get fast, and may use more memory. The JVM configuration is requested using --jvm. To check you are using the JVM configuration, ruby --version should not mention Native.

If you are running a short-running program you probably want the default, native, configuration. If you are running a long-running program and want the highest possible performance you probably want the JVM configuration, by using --jvm.

At runtime you can tell if you are using the native configuration using TruffleRuby.native?.

You won't encounter it when using TruffleRuby from the GraalVM, but there is also another configuration which is TruffleRuby running on the JVM but with the GraalVM Compiler not available. This configuration will have much lower performance and should normally only be used for development. ruby --version will mention Interpreter for this configuration.

System compatibility

TruffleRuby is actively tested on these systems:

  • Oracle Linux 7
  • Ubuntu 18.04 LTS
  • Ubuntu 16.04 LTS
  • Fedora 28
  • macOS 10.14 (Mojave)
  • macOS 10.13 (High Sierra)

You may find that TruffleRuby will not work if you severely restrict the environment, for example by unmounting system filesystems such as /dev/shm.


  • LLVM to build and run C extensions
  • libssl for the openssl C extension
  • zlib for the zlib C extension

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.

Current status

We recommend that people trying TruffleRuby on their gems and applications get in touch with us for help.

TruffleRuby is progressing fast but is currently probably not ready for you to try running your full Rails application on. However it is ready for experimentation and curious end-users to try on their gems and smaller applications, and to send us reports of issues they find.

Migration from MRI

TruffleRuby should in most cases work as a drop-in replacement for MRI, but you should read about our compatibility.

Migration from JRuby

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.


Extensive documentation is available in doc.

See our source code repository and contributor documentation to contribute to TruffleRuby.


The best way to get in touch with us is to join us in, but you can also Tweet to @TruffleRuby, or email

Please report security vulnerabilities via the process outlined at reporting vulnerabilities guide, rather than by something public such as a GitHub issue or a Gitter conversation.

Mailing list

Announcements about GraalVM, including TruffleRuby, are made on the graal-dev mailing list.


The main authors of TruffleRuby in order of joining the project are:

  • Chris Seaton
  • Benoit Daloze
  • Kevin Menard
  • Petr Chalupa
  • Brandon Fish
  • Duncan MacGregor
  • Christian Wirth


  • Thomas Würthinger
  • Matthias Grimmer
  • Josef Haider
  • Fabio Niephaus
  • Matthias Springer
  • Lucas Allan Amorim
  • Aditya Bhardwaj

Collaborations with:

And others.


See the security documentation.


TruffleRuby is copyright (c) 2013-2019 Oracle and/or its affiliates, and is made available to you under the terms of any one of the following three licenses:

  • Eclipse Public License version 1.0, or
  • GNU General Public License version 2, or
  • GNU Lesser General Public License version 2.1.

TruffleRuby contains additional code not always covered by these licences, and with copyright owned by other people. See doc/legal/ for full documentation.


TruffleRuby is a fork of JRuby, combining it with code from the Rubinius project, and also containing code from the standard implementation of Ruby, MRI.

You can’t perform that action at this time.