Can';t在OS X上安装自制软件或更新Ruby

Can';t在OS X上安装自制软件或更新Ruby,ruby,homebrew,macos-high-sierra,dyld,Ruby,Homebrew,Macos High Sierra,Dyld,我在OS X上安装自制软件时遇到问题。OS版本是10.13.3版 正在尝试运行: /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 它返回: dyld: Library not loaded: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/libruby.2.3.0.d

我在OS X上安装自制软件时遇到问题。OS版本是10.13.3版

正在尝试运行:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
它返回:

dyld: Library not loaded: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/libruby.2.3.0.dylib
Referenced from: /usr/bin/ruby
Reason: Incompatible library version: ruby requires version 2.3.3 or later, but libruby.2.3.0.dylib provides version 2.3.0
Abort trap: 6
人们说要通过rvmrbenv更新Ruby,但没有成功

试一试:

\curl -sSL https://get.rvm.io | bash -s stable
Downloading https://github.com/rvm/rvm/archive/1.29.3.tar.gz
Downloading https://github.com/rvm/rvm/releases/download/1.29.3/1.29.3.tar.gz.asc
Found PGP signature at: 'https://github.com/rvm/rvm/releases/download/1.29.3/1.29.3.tar.gz.asc',
but no GPG software exists to validate it, skipping.

Upgrading the RVM installation in /Users/m1-user/.rvm/
RVM PATH line found in /Users/m1-user/.mkshrc /Users/m1-user/.profile /Users/mm-user/.bashrc /Users/mm-user/.zshrc.
RVM sourcing line found in /Users/m1-user/.profile /Users/mm-user/.zlogin.
RVM sourcing line not found for Bash, rerun this command with '--auto-dotfiles' flag to fix it.
Upgrade of RVM in /Users/m1-user/.rvm/ is complete.

Upgrade Notes:

  * No new notes to display.
之后:

$ rvm install ruby-2.4.1
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.13/x86_64/ruby-2.4.1.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
About to install Homebrew, press `Enter` for default installation in `/usr/local`,
type new path if you wish custom Homebrew installation (the path needs to be writable for user)
: 
dyld: Library not loaded: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/libruby.2.3.0.dylib
Referenced from: /usr/bin/ruby
Reason: Incompatible library version: ruby requires version 2.3.3 or later, but libruby.2.3.0.dylib provides version 2.3.0
Requirements installation failed with status: 134.
所以这就像是一个恶性循环:我不能安装homebrew,因为ruby的旧版本,我不能更新ruby,因为我需要安装homebrew


有什么帮助吗?

听起来您需要卸载ruby,然后尝试安装Homebrew。一旦自制软件开始工作,你就可以重新安装ruby了。RVM需要自制,根据此

经过大量搜索,我没有找到正确的解决方案。但我试图通过自己编译来更新Ruby。这对我很有效。所以也许它也会帮助一些人

首先,您需要从下载Ruby源代码,您可以选择任何稳定的版本。我下载了2.5.0

然后提取归档文件并将其复制到Ruby文件夹:

# Replace path below to correct path to extracted folder
sudo cp -r /Users/your-user/Downloads/ruby-2.5.0 /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/
然后将目录更改为复制的文件夹:

cd /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/ruby-2.5.0
然后,您应该通过运行以下命令来编译它:

sudo ./configure
sudo make
sudo make install
然后,您可以列出可用的Ruby版本并选择一个进行安装:

# Will list available versions
rvm list known
# Choose from available and install it
rvm install ruby-2.4.1

在成功安装自制软件之后。

这是最后的选择,但您始终可以尝试从源代码安装。虽然没有自制软件,您可能还需要从源代码安装一些依赖项。至少我认为您需要
autoconf
。如果你不知道怎么做,我可以留下一些步骤的答案。自制软件需要安装ruby