无法通过 Mac M1 Silicon Chip 上的 rvm 安装任何 ruby 版本

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

错误响应示例:

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

  1. 右键单击“应用程序/实用工具”文件夹中的“终端”,获取信息,勾选“使用 Rosetta 打开”框。
  2. 卸载自制程序
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh)"
rm -rf /opt/homebrew/*
sudo rm -rf /opt/homebrew
  1. 重新安装自制程序
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  1. 重启终端
  2. 检查 Homebrew 是否工作正常:
    brew doctor
  3. 重新安装openssl:
    brew install openssl
  4. 安装 Ruby:
    rvm install 2.7
    或任何版本
rubygems apple-m1 apple-silicon
3个回答
2
投票

以下内容对我有用 - 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

0
投票

以下对我有用 -

''RUBY_CONFIGURE_OPTS=--with-openssl-dir=/opt/homebrew/etc/[电子邮件受保护] rvm install 3.3.0''


-4
投票

简单地卸载并安装brew和rvm就帮我解决了问题。

  • 卸载rvm
  • 卸载brew
  • 确保您的点文件中没有 openssl 库添加到您的路径中
  • 更新到最新的 xcode 命令行工具
  • 安装brew
  • 手动安装openssl
  • 安装rvm
  • 安装你喜欢的任何 ruby 版本

请不要安装brew或用rosetta启动终端,这或多或少会大大减慢一切速度。

编辑:看起来这只适用于 ruby 版本 >= 2.7.2 2.7.2 之前的 ruby 版本也会有同样的问题。

© www.soinside.com 2019 - 2024. All rights reserved.