一.pod install报错
[!] CocoaPods could not find compatible versions for pod "MBProgressHUD":
In snapshot (Podfile.lock):
MBProgressHUD (= 1.1.0, ~> 1.1.0)
In Podfile:
MBProgressHUD
None of your spec sources contain a spec satisfying the dependencies: `MBProgressHUD, MBProgressHUD (= 1.1.0, ~> 1.1.0)`.
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.
这个报错翻译下来,大体意思是CocoaPods找不到MBProgressHUD。但是MBProgressHUD这个库一定存在,我又试验了一下其他项目是可以更新的,那说明是CocoaPods出了问题,通过打印CocoaPods版本,ruby版本,CocoaPods源,排除了这些问题。再排查缓存过程中,发现清完缓存后报错消失。终端语句如下:
// 移除本地master
sudo rm -fr ~/.cocoapods/repos/master
// 移除本地缓存
sudo rm -fr ~/Library/Caches/CocoaPods/
二. bad interpreter
前几天更新了一下系统,然后更新pod时遇到了这个报错
/Users/bailashu_iOS_caoyu/Desktop/防刺项目/fever_ios/Fever_iOS
bailashudeiMac:Fever_iOS bailashu_iOS_caoyu$ pod install
-bash: /usr/local/bin/pod: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby: bad interpreter: No such file or directory
更新一下CocoaPods就好了,
sudo gem update --system
sudo gem install cocoapods -n/usr/local/bin
三.frameworks.sh: Permission denied
/Users/bailashu_iOS_caoyu/Library/Developer/Xcode/DerivedData/xxxxx-bmniugohpvukoxgloedlxhbfjynh/Build/Intermediates.noindex/EdlOA.build/Debug-iphoneos/xxxxx.build/Script-90EC510D54F8CB3BFED7B11F.sh: line 2: /Users/bailashu_iOS_caoyu/Desktop/xxxxx/Pods/Target Support Files/Pods-xxxxx/Pods-xxxxx-frameworks.sh: Permission denied
字面意思就是没有权限执行这个文件的权限,在终端给该文件赋权即可,打开到文件所在位置执行命令
chmod +x "文件名"
其中操作符号可以是:+ 添加某个权限;- 取消某个权限;= 赋予给定权限并取消其他所有权限(如果有的话)。r 可读;w 可写;x 可执行;X 只有目标文件对某些用户是可执行的或该目标文件是目录时才追加x 属性;s 在文件执行时把进程的属主或组ID置为该文件的文件属主。方式“u+s”设置文件的用户ID位,“g+s”设置组ID位;t 保存程序的文本到交换设备上;u 与文件属主拥有一样的权限;g 与和文件属主同组的用户拥有一样的权限;o 与其他用户拥有一样的权限;文件名:以空格分开的要改变权限的文件列表,支持通配符。