- Latest (22.3)
- Dev Build
- Java Reference
- Java on Truffle
- LLVM Languages Reference
- Python Reference
- Ruby Reference
- Debugging Ruby
- Runtime Configurations
- Using Ruby with GraalVM
- Installing `libssl`
- Installing Make and GCC
- Installing `zlib`
- Migration from JRuby to Ruby
- TruffleRuby Options and Command Line
- Polyglot Programming
- Ruby Managers and Installers
- Standalone Distribution
- Development Tools for Ruby
- Ruby Additional Functionality
- Setting up a UTF-8 Locale
- Reporting Performance Problems
- Optcarrot Example
- R Reference
- WebAssembly Reference
Using TruffleRuby with GraalVM
GraalVM is the platform on which TruffleRuby runs.
Installing GraalVM enables you to run TruffleRuby both in the
--jvm runtime configurations.
TruffleRuby’s dependencies need to be installed for TruffleRuby to run correctly.
Community Edition and Enterprise Edition #
GraalVM is available in a Community Edition, which is open-source, and an Enterprise Edition which has better performance and scalability. See the website for a comparison.
Installing the Base Image #
GraalVM starts with a base image which provides the platform for high-performance language runtimes.
The Community Edition base image can be installed from GitHub, under an open source licence.
The Enterprise Edition base image can be installed from Oracle Downloads page by accepting the Oracle License Agreement.
Nightly builds of the GraalVM Community Edition are also available.
Whichever edition you choose, you will obtain a tarball which you can extract.
There will be a
bin directory (
Contents/Home/bin on macOS) which you can add to your
$PATH if you want to.
Installing with asdf #
Installing Ruby and Other Languages #
After installing GraalVM you then need to install the Ruby language into it.
This is done using the
The Ruby package is the same for both editions of GraalVM and comes from GitHub:
gu install ruby
This command will show a message regarding running a post-install script.
This is necessary to make the Ruby
openssl C extension work with your system libssl.
Please run that script now.
The path of the script will be:
# Java 8 jre/languages/ruby/lib/truffle/post_install_hook.sh # Java 11+ languages/ruby/lib/truffle/post_install_hook.sh # Generic $(path/to/graalvm/bin/ruby -e 'print RbConfig::CONFIG["prefix"]')/lib/truffle/post_install_hook.sh
Using a Ruby Manager #
Inside GraalVM is a
languages/ruby directory which has the usual structure of a Ruby implementation. It is recommended to add this directory to a Ruby manager.
See configuring Ruby managers for more information.