Version
- 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
Setting Up a UTF-8 Locale
You need a UTF-8 locale to run some Ruby applications. For example, we have found that RubyGems and ruby/spec need such a locale.
This is not needed if the $LANG
environment variable is already set and:
locale
shows no ="C"
and no warning.
Instead, all values should be "en_US.UTF-8"
or other regions but still .UTF-8
.
Fedora-based: RHEL, Oracle Linux, etc #
export LANG=en_US.UTF-8
Debian-based: Ubuntu, etc #
Ubuntu
The Ubuntu version of locale-gen
supports arguments, so it is easy:
sudo apt-get install -y locales
sudo locale-gen en_US.UTF-8
export LANG=en_US.UTF-8
Non-Ubuntu
Debian and other non-Ubuntu do not support locale-gen
arguments.
Instead you need to modify /etc/locale.gen
:
# Uncomment the en_US.UTF-8 line in /etc/locale.gen
sudo sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen
# locale-gen generates locales for all uncommented locales in /etc/locale.gen
sudo locale-gen
export LANG=en_US.UTF-8
For Dockerfile’s:
# Uncomment the en_US.UTF-8 line in /etc/locale.gen
RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen
# locale-gen generates locales for all uncommented locales in /etc/locale.gen
RUN locale-gen
ENV LANG=en_US.UTF-8