cocoapods升级1.0.x的问题
2016-06-06 本文已影响92人
Smallwolf_JS
段时间使用CocoaPods的时候看到可以升级1.0.0了,现在使用的版本是0.39.0,就想着什么时候升级成最新的,没想到今天升级的时候碰到一堆问题。还能不能一起玩耍了啊。

看到上面的升级提示,是不是觉得很简单,好吧,那就按照提示打开终端输入
gem install cocoapods
结果报错,说我没有写的权限。我自己的电脑还不让我写了。。 。

那好吧,前面加个sudo 试试:
sudo gem install cocoapods

找找原因,发现 /usr/bin/ 这个目录下并没有 xcodeproj这个文件。当初安装的时候放在了 /usr/local/bin 目录下。找到了安装路径,那就再换了命令。
sudo gem install -n /usr/local/bin cocoapods
这下成功了,看一下版本号 pod –version ,也是1.0.1了。
新建一个工程,用CocoaPods安装一个库看看。结果
The dependency HP_Util
is not used in any concrete target.

看看官网的介绍我们知道了

只要在Podfile 里加上下面这段就好了。
target 'Project name' do
end
在添加一次第三方,pod install , OK!