- GraalVM for JDK 23 (Latest)
- GraalVM for JDK 24 (Early Access)
- GraalVM for JDK 21
- GraalVM for JDK 17
- Archives
- Dev Build
- Ruby Reference
- Compatibility
- Debugging Ruby
- Runtime Configurations
- Using Ruby with GraalVM
- Installing `libssl`
- Installing LibYAML
- 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
- Security
- Optcarrot Example
- FAQ
Using TruffleRuby with GraalVM
GraalVM is the platform on which TruffleRuby runs.
Installing GraalVM enables you to run TruffleRuby both in the --native
and --jvm
runtime configurations.
Dependencies #
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 #
Using asdf and asdf-java installation is as easy as
asdf install java graalvm-20.1.0+java11
(look up versions via asdf list-all java | grep graalvm
).
Installing Ruby and Other Languages #
After installing GraalVM you then need to install the Ruby language into it.
This is done using the gu
command.
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:
languages/ruby/lib/truffle/post_install_hook.sh
You can also download the latest Ruby component (ruby-installable-...
) manually from GitHub (CE)
or from Oracle Downloads (EE).
Then install it with gu install --file path/to/ruby-installable-...
.
Using a Ruby Manager #
Inside GraalVM is a jre/languages/ruby
or 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.