在利用pod导入Alamofire时,执行pod install或pod update遇到了这样一个错误:
[!] Unable to satisfy the following requirements:
Alamofire (~> 4.4)
required byPodfile
None of your spec sources contain a spec satisfying the dependency: Alamofire (~> 4.4)
.
You have either:
* out-of-date source repos which you can update with pod 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.
提示的意思就是:源库里面不包含Alamofire (~> 4.4),需要更新cocoaPods镜像库。所有升级一下cocoaPods就可以解决问题,按下面升级步骤升级完后,再执行pod install或pod update,就正常了。升级步骤如下:
一:查看ruby源
指令:
$ gem sources