Cocoapod错误

当我从Xcode 6.3切换到Xcode6.4的时候,因为我是mac上安装了两个不同的版本,现在把Xcode 6.3卸掉了。
现在再次运行pod install命令的时候,提示如下错误:
 
Updating local specs repositories
xcrun: error: active developer path ("/Applications/Xcode6.3/Xcode.app/Contents/Developer") does not exist, use `xcode-select --switch path/to/Xcode.app` to specify the Xcode that you wish to use for command line developer tools (or see `man xcode-select`)
 
大致意思就是/Applications/Xcode6.3/Xcode.app/Contents/Developer这个路径找不到了。
因为我已经卸载掉了Xcode6.3,自然就找不到了。哈哈
所以要把路径切换到新的Xcode6.4下。
 

所以 运行一下命令行:

sudo xcode-select -switch /Applications/Xcode 6.4/Xcode.app/Contents/Developer 
 
意思就是把选择Xcode路径切换到/Applications/Xcode 6.4/Xcode.app/Contents/Developer 这个路径下。
 
再次运行pod install就一切正常了。
 
总结:当不是通过系统自动升级,而是又重新下载一个安装包安装Xcode的时候,可能会出现这个问题。只需要运行一下命令就行了。
 
原文地址:https://www.cnblogs.com/guangleijia/p/4835871.html