我尝试了 rvm 安装 2.1,但收到此错误 xcode-select: 错误:无效的开发人员目录



我尝试了 rvm install 2.1

我得到了这个错误:

xcode-select: 错误: 无效的开发人员目录 '/Library/Developer/CommandLineTools' 在以下过程中失败:/usr/bin/sudo/usr/bin/xcode-select --switch/Library/Developer/CommandLineTools

这发生在我尝试用红宝石进行黄瓜测试时。

我的 ruby 版本是 2.0,rvm 版本是 1.29.3 我无法升级。我安装了 Xcode

请运行xcode-select --install将其更新到最新版本。

如果您仍然遇到问题,请检查您的 xcode 选择路径与 xcode-select -p 并找到正确的路径来分配它。

就我而言,我的路径是: /Library/Developer/CommandLineTools

因此,要更改路径,只需运行:sudo xcode-select -switch /Library/Developer/CommandLineTools

从以下链接 https://developer.apple.com/download/more/安装 xcode-command-line-tools

注意:此方法需要Apple开发人员帐户

运行以下命令

xcode-select --install 

如果您使用测试版,请在路径中尝试"Xcode-beta.app":

sudo xcode-select --switch /Applications/Xcode-beta.app/Contents/Developer

最新更新