Unable to install Ruby 3.1.4 via rbenv on AlmaLinux/CentOS 7

913 views Asked by At

I am trying to install Ruby 3.14 on an AlmaLinux distrubtion via rbenv. Seems the build and the compiler are not compatible.

Has anybody seen this issue before and possibly found a solution?

It is strictly speaking not an issue with 3.1.4 fails same way on 3.2.2.

Many thanks in advance for you time taken:) Eugen

Command

rbenv install 3.1.4

Error

To follow progress, use 'tail -f /tmp/ruby-build.20230623120844.43521.log' or pass --verbose
Downloading ruby-3.1.4.tar.gz...
-> https://cache.ruby-lang.org/pub/ruby/3.1/ruby-3.1.4.tar.gz

Installing ruby-3.1.4...

BUILD FAILED (CentOS Linux 7 using ruby-build 20230615)

Inspect or clean up the working tree at /tmp/ruby-build.20230623120844.43521.Nn4Kag

Results logged to /tmp/ruby-build.20230623120844.43521.log

Last 10 log lines:

cc1: warning: unrecognized command line option "-Wno-cast-function-type" [enabled by default]
make: *** [mjit_compile.o] Error 1
make: *** [ruby.o] Error 1
compile.c: At top level:
cc1: warning: unrecognized command line option "-Wno-tautological-compare" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-self-assign" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-parentheses-equality" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-constant-logical-operand" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-cast-function-type" [enabled by default]
make: *** [compile.o] Error 1

rbenv updated

FYI - I updated rbenv before running the install command.

cd ~/.rbenv
git pull
cd ~/.rbenv/plugins/ruby-build
git pull

gcc

gcc -v

Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper Target: x86_64-redhat-linux Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux Thread model: posix gcc version 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC)

About the system

Linux version 3.10.0-1160.88.1.el7.x86_64 ([email protected]) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC) ) #1 SMP Tue Mar 7 15:41:52 UTC 2023

/etc/os-release

NAME="CentOS Linux"
VERSION="7 (Core)"
1

There are 1 answers

0
smile2day On

Solved through this question, many thanks!

With root permissions

yum install centos-release-scl-rh
yum install devtoolset-7-gcc-c++

As rbenv user

CC=/opt/rh/devtoolset-7/root/usr/bin/gcc rbenv install 3.1.4 -v