错误响应示例:
TTRAN-YK0WK9W9PM:virtual_terminal tuantran$ rvm install 2.7.6
ruby-2.7.6 - #removing src/ruby-2.7.6..
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/12.3/arm64/ruby-2.7.6.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Certificates bundle '/usr/local/etc/[email protected]/cert.pem' is already up to date.
Requirements installation successful.
Installing Ruby from source to: /Users/tuantran/.rvm/rubies/ruby-2.7.6, this may take a while depending on your cpu(s)...
ruby-2.7.6 - #downloading ruby-2.7.6, this may take a while depending on your connection...
ruby-2.7.6 - #extracting ruby-2.7.6 to /Users/tuantran/.rvm/src/ruby-2.7.6.....
ruby-2.7.6 - #configuring.........................................................................
ruby-2.7.6 - #post-configuration.
ruby-2.7.6 - #compiling......................................................
Error running '__rvm_make -j10',
please read /Users/tuantran/.rvm/log/1658248808_ruby-2.7.6/make.log
There has been an error while running make. Halting the installation.
解决方案:https://github.com/rvm/rvm/issues/5153
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh)"
rm -rf /opt/homebrew/*
sudo rm -rf /opt/homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew doctor
brew install openssl
rvm install 2.7
或任何版本以下内容对我有用 - https://github.com/rvm/rvm/issues/5153#issuecomment-1301062739
brew install libffi
export PKG_CONFIG_PATH="/opt/homebrew/opt/libffi/lib/pkgconfig"
LDFLAGS="-L/opt/homebrew/opt/libffi/lib" CPPFLAGS="-I/opt/homebrew/opt/libffi/include" rvm install 2.5.1
以下对我有用 -
''RUBY_CONFIGURE_OPTS=--with-openssl-dir=/opt/homebrew/etc/[电子邮件受保护] rvm install 3.3.0''
简单地卸载并安装brew和rvm就帮我解决了问题。
请不要安装brew或用rosetta启动终端,这或多或少会大大减慢一切速度。
编辑:看起来这只适用于 ruby 版本 >= 2.7.2 2.7.2 之前的 ruby 版本也会有同样的问题。