无法在AlmaLinux/CentOS 7上通过rbenv安装Ruby 3.1.4

问题描述 投票:0回答:1

我正在尝试通过 rbenv 在 AlmaLinux 发行版上安装 Ruby 3.14。似乎构建和编译器不兼容。

有人以前见过这个问题并可能找到解决方案吗?

严格来说,这不是 3.1.4 的问题,在 3.2.2 上也以同样的方式失败。

提前非常感谢您花费的时间:) Eugen

命令

rbenv install 3.1.4

错误

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 已更新

仅供参考 - 我在运行安装命令之前更新了

rbenv

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

海湾合作委员会

gcc -v

使用内置规格。 COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper 目标:x86_64-redhat-linux 配置为:../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 线程模型:posix gcc 版本 4.8.5 20150623(红帽 4.8.5-44)(GCC)

关于系统

Linux 版本 3.10.0-1160.88.1.el7.x86_64 ([email protected]) (gcc 版本 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC) ) #1 SMP 周二三月7 15:41:52 世界标准时间 2023

/etc/os-release

NAME="CentOS Linux"
VERSION="7 (Core)"
linux centos7 rbenv almalinux ruby-3.1
1个回答
0
投票

通过这个问题解决了,非常感谢!

具有root权限

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

作为 rbenv 用户

CC=/opt/rh/devtoolset-7/root/usr/bin/gcc rbenv install 3.1.4 -v
© www.soinside.com 2019 - 2024. All rights reserved.