Ruby managers and installers
If you installed GraalVM, it is recommended to add TruffleRuby to a Ruby manager. See Configuring Ruby managers for the full GraalVM distribution below.
Installing TruffleRuby with RVM, ruby-build or ruby-install
TruffleRuby is supported by the 3 major Ruby installers.
Upgrade RVM to let RVM know about the latest TruffleRuby release:
rvm get head
Install TruffleRuby with:
rvm install truffleruby
ruby-build and rbenv
First, you need to upgrade
ruby-build to get the latest TruffleRuby
ruby-build's instructions for upgrading.
Check the latest available version of TruffleRuby with:
rbenv install --list | grep truffleruby
Then install the latest TruffleRuby with:
rbenv install truffleruby-[LATEST_VERSION]
ruby-install and chruby
First, you need at least
ruby-install 0.7.0 to get TruffleRuby support.
Check your version with:
If it is older than
0.7.0, you need to update to latest
Follow the installation instructions,
since the steps for upgrading
ruby-install are the same as the steps for
Then install TruffleRuby with:
ruby-install --latest ruby-install truffleruby
There are also instructions on the chruby wiki if you prefer to install TruffleRuby manually.
Configuring Ruby managers for the full GraalVM distribution
When installing GraalVM, it is recommended to add TruffleRuby to a Ruby manager for ease of use.
First, install GraalVM and Ruby. Make sure you ran the post-install script before adding GraalVM to Ruby managers.
Then follow these steps to integrate GraalVM with your Ruby manager.
To add TruffleRuby to
rbenv, create a symbolic link in the
$ ln -s path/to/graalvm/jre/languages/ruby "$RBENV_ROOT/versions/truffleruby" $ rbenv shell truffleruby $ ruby --version
To add TruffleRuby to
chruby, create a symbolic link to the
$ ln -s path/to/graalvm/jre/languages/ruby "$HOME/.rubies/truffleruby" $ chruby truffleruby $ ruby --version
RVM has a command for adding a precompiled Ruby to the list of available rubies.
$ rvm mount path/to/graalvm/jre/languages/ruby -n truffleruby $ rvm use ext-truffleruby $ ruby --version
Note that on macOS the path is slightly different, and will be
Using TruffleRuby without a Ruby manager
If you are using a Ruby manager like
chruby and wish not to
add TruffleRuby to one of them make sure that the manager does not set
GEM_ROOT. The variables
are picked up by TruffleRuby (as any other Ruby implementation would do)
causing TruffleRuby to pickup the wrong Gem home instead of its own.
One way to fix this for all sessions is to tell TruffleRuby to ignore
variables and always use its own Gem home under
# In ~/.bashrc or ~/.zshenv $ export TRUFFLERUBY_RESILIENT_GEM_HOME=true
It can also be fixed just for the current terminal by clearing the environment with one of the following commands:
$ rbenv system $ chruby system $ rvm use system # Or manually: $ unset GEM_HOME GEM_PATH GEM_ROOT