安装rvm报错There has been an error while running configure. Halting the installation

1,628 阅读1分钟
\curl -sSL https://get.rvm.io | bash -s stable --ruby

使用上述命令安装rvm时报错:Error running 'env CFLAGS=-O3 xxxxxxxxxxxx ./configure --prefix=/Users/xxx/.rvm/rubies/ruby-3.0.0 --disable-install-doc --enable-shared', please read /Users/xxx/.rvm/log/1668063940_ruby-3.0.0/configure.log There has been an error while running configure. Halting the installation.

根据报错找到configure.log文件并打开,最后3行如下:

configure: error: cannot run C compiled programs.
If you meant to cross compile, use '--host'.
See 'config.log' for more details

提示执行./configure时需要设置--host参数
host参数为cpu架构,linux或macos可执行‘uname -a’查看,如:x86_64

cd ~/.rvm/src/ruby-3.0.0
./configure --host=x86_64

执行后即可完成rvm的安装

image.png