iOS之cocoa pod的使用问题一

当我们从Github 上Download下一份代码之后,我们就会需要把对应的一些第三方框架通过CocoaPod的方式导入进来,那么我们会使用到以下命令去安装对应的第三方框架:

pod install --no-repo-update

但是当我们敲下回车键后,出现了如下报错:

/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.2.0/lib/cocoapods/executable.rb:89: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777
Analyzing dependencies
[!] Unable to satisfy the following requirements:

- `AMapLocation` required by `Podfile`
- `AMapLocation (= 2.3.1)` required by `Podfile.lock`

None of your spec sources contain a spec satisfying the dependencies: `AMapLocation, AMapLocation (= 2.3.1)`.

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.

截图如下:

Snip20170601_552.png

这个时候我们就会开始懵逼了,我***什么鬼,WTF!这是一个正常程序员的反应。但是当我们仔细读一下这个警告内容会发现其实并不难,大体意思是:我们spec sources中并不包含依赖AMaplocation以及AMaplocation(= 2.3.1)这两个东西,所以我们需要更新一下这个库。我们看下其中红色部分提到了"pod repo update"和"pod install",既然是命令,那就不管三七二十一了,直接上命令呗,先上"pod install",发现并不行,还是报同样的错误:

Snip20170601_553.png

既然是这样,那就试试"pod repo update"呗,效果如下:

Snip20170601_554.png

库已经更新完毕了,就开始安装第三方框架了:

Snip20170601_555.png

问题得到解决,其实我们只要仔细的去看看大体报错的意思就能把问题解决,很多问题难就难在它是用英文表达出来的!!!
以上!

小七.jpg
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容