Experimental feature in GraalVM

设置 UTF-8 区域设置

您需要一个 UTF-8 区域设置来运行某些 Ruby 应用程序。例如,我们发现 RubyGems 和 ruby/spec 需要这样的区域设置。

如果 $LANG 环境变量已设置且

locale

未显示 ="C" 或任何警告,则不需要。相反,所有值都应为 "en_US.UTF-8" 或其他区域但仍包含 .UTF-8

基于 Fedora:RHEL、Oracle Linux 等 #

export LANG=en_US.UTF-8

基于 Debian:Ubuntu 等 #

Ubuntu

locale-gen 的 Ubuntu 版本支持参数,因此很容易

sudo apt-get install -y locales
sudo locale-gen en_US.UTF-8
export LANG=en_US.UTF-8

非 Ubuntu

Debian 和其他非 Ubuntu 系统不支持 locale-gen 参数。相反,您需要修改 /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

对于 Dockerfile

# 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

联系我们