1、cocoapods安裝報錯
sudo gem install cocoapods
的時候出現(xiàn)
While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /usr/bin directory.
改為
sudo gem install -n /usr/local/bin cocoapods
即可
2、cocoapods卸載報錯
sudo gem uninstall cocoapods
的時候出現(xiàn)
While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /usr/bin directory.
改為
sudo gem uninstall -n /usr/local/bin cocoapods
即可
3徒蟆、Mac OS 10.14 安裝cocoapods報錯: Failed to build gem native
如果是之前的 Mac OS 版本杉辙,網上都是通過 xcode-select --install 來解決薛匪,但是我在 Mac OS 10.14 版本下移必,依然存在報錯啄踊。
最終找到解決方式掖蛤,執(zhí)行:
open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
然后根據(jù)提示安裝即可杀捻。
4、CocoaPods could not find compatible versions for pod "xxx": In snapshot (Podfile.lock):
[!] CocoaPods could not find compatible versions for pod "MJRefresh":
In snapshot (Podfile.lock):
MJRefresh (= 3.1.15.3)
In Podfile:
MJRefresh
None of your spec sources contain a spec satisfying the dependencies: `MJRefresh, MJRefresh (= 3.1.15.3)`.
You have either:
* out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
* mistyped the name or version.
* not added the source repo that hosts the Podspec to your Podfile.
Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by default.
解決方法:
把.xcworkspace和Podfile.lock文件刪除蚓庭,重新pod install一下就好了致讥!