rbenv / ruby-build

A tool to download, compile, and install Ruby on Unix-like systems.
https://rbenv.org/man/ruby-build.1
MIT License
3.89k stars 785 forks source link

Instructions out of date for RHEL 8/9 #2437

Closed mcandre closed 3 months ago

mcandre commented 3 months ago

When I try to install Ruby on RHEL (8/9), then yum and dnf note that there is no package called libyaml-devel, and that the version of GCC cited no longer exists.

Let's remove the -6 version suffix entirely from the GCC package, for maintainability with future OS versions that will grow this number over time.

In recent versions of RHEL, the libyaml-devel package is hidden by default. RHEL users will need to explicitly enable some package groups:

# RHEL 8 based distros:
dnf config-manager --set-enabled powertools

# RHEL 9 based distros:
dnf config-manager --set-enabled crb

dnf install libyaml-devel

Per https://github.com/rvm/rvm/issues/5288#issuecomment-1387705721

For comparison, RVM uses Ruby's built-in libyaml implementation:

https://github.com/rvm/rvm/issues/2998#issuecomment-330061538

Ruby is one of the more complicated programming languages to install. Would be nice to have a tarball of pre-compiled binaries, independent of package management install media, in order to provide a dead simple way to get Ruby in contexts like ephemeral CI/CD environments and Docker FROM scratch images.

mcandre commented 3 months ago

What's more, the instructions differ between the old CentOS variant vs RHEL.

CentOS used a repository called powertools, a debranded copy of codeready builder for rhel. In other words...

Only then will libyaml-devel (RHEL family package name) become available to install via dnf/yum.

The handy short name crb does not appear to be available in RHEL 8.

So Debian uses libyaml-dev, Alpine uses yaml-dev, and Void Linux uses libyaml-devel. Not to mention other Linux distributions.

mislav commented 3 months ago

Hi, thanks for bringing this to my attention. I've updated CentOS/RHEL instructions to read:

yum install -y autoconf gcc patch bzip2 openssl-devel libffi-devel readline-devel zlib-devel gdbm-devel ncurses-devel tar

The wiki where these instructions are is community-editable, so feel free to make tweaks to the instructions too. I'm personally not familiar with most operating systems that we maintain installation instructions for, so I'm dependent on people like you to keep the instructions valid and up-to-date for the systems you have experience with.