Skip to content

TruffleRuby

Shannon Skipper edited this page May 19, 2020 · 12 revisions

TruffleRuby is a Ruby implementation using the GraalVM.

Requirements

See TruffleRuby Dependencies.

Install

See the TruffleRuby Standalone Distribution installation instructions for an up-to-date installation guide. The following shows installing TruffleRuby in a location that chruby will automatically detect.

First, Pick a Version to Install

Export an environment variable to select the TruffleRuby version to install. Check the TruffleRuby Releases for the latest version.

export TRUFFLERUBY_VERSION=<desired_version>

Choose Linux or macOS

Linux

curl -LO https://github.com/oracle/truffleruby/releases/download/vm-$TRUFFLERUBY_VERSION/truffleruby-$TRUFFLERUBY_VERSION-linux-amd64.tar.gz
sudo mkdir -p /opt/rubies/
sudo tar -xzvf truffleruby-$TRUFFLERUBY_VERSION-linux-amd64.tar.gz -C /opt/rubies/
sudo mv /opt/rubies/truffleruby-$TRUFFLERUBY_VERSION-linux-amd64 /opt/rubies/truffleruby-$TRUFFLERUBY_VERSION
/opt/rubies/truffleruby-$TRUFFLERUBY_VERSION/lib/truffle/post_install_hook.sh

macOS

curl -LO https://github.com/oracle/truffleruby/releases/download/vm-$TRUFFLERUBY_VERSION/truffleruby-$TRUFFLERUBY_VERSION-macos-amd64.tar.gz
mkdir -p ~/.rubies
tar -xzvf truffleruby-$TRUFFLERUBY_VERSION-macos-amd64.tar.gz -C ~/.rubies
mv ~/.rubies/truffleruby-$TRUFFLERUBY_VERSION-macos-amd64 ~/.rubies/truffleruby-$TRUFFLERUBY_VERSION
~/.rubies/truffleruby-$TRUFFLERUBY_VERSION/lib/truffle/post_install_hook.sh

Use TruffleRuby

Restart your shell or source chruby.sh and switch Rubies to TruffleRuby.

chruby truffleruby
ruby -v #=> truffleruby ...
Clone this wiki locally