cocoapods安装出错问题

今天执行pod install时,出现了错误,提示更新,好,那就更新;

1.终端执行了下:gem sources -l   查看了下源

*** CURRENT SOURCES ***

 

https://ruby.taobao.org/

 

 

还好,已经是taobao的源了,下面继续

2.终端执行:sudo gem install cocoapods,提示信息如下

Fetching: cocoapods-core-1.0.1.gem (100%)

Successfully installed cocoapods-core-1.0.1

Fetching: xcodeproj-1.3.0.gem (100%)

ERROR:  While executing gem ... (Errno::EPERM)

    Operation not permitted - /usr/bin/xcodeproj

貌似gem出错了,看了网上大神的解决办法,再看看cocoapods官网

3.终端执行: sudo gem install -n /usr/local/bin cocoapods --pre,满心欢喜的看着数据在走

Fetching: cocoapods-core-1.1.0.beta.2.gem (100%)

Successfully installed cocoapods-core-1.1.0.beta.2

Fetching: cocoapods-deintegrate-1.0.1.gem (100%)

Successfully installed cocoapods-deintegrate-1.0.1

Fetching: cocoapods-downloader-1.1.1.gem (100%)

Successfully installed cocoapods-downloader-1.1.1

Fetching: cocoapods-try-1.1.0.gem (100%)

Successfully installed cocoapods-try-1.1.0

Fetching: molinillo-0.5.0.gem (100%)

Successfully installed molinillo-0.5.0

Successfully installed xcodeproj-1.3.0

Fetching: fourflusher-1.0.1.gem (100%)

Successfully installed fourflusher-1.0.1

Fetching: gh_inspector-1.0.2.gem (100%)

Successfully installed gh_inspector-1.0.2

Fetching: cocoapods-1.1.0.beta.2.gem (100%)

ERROR:  Error installing cocoapods:

invalid gem: package is corrupt, exception while verifying: undefined method `size' for nil:NilClass (NoMethodError) in /Library/Ruby/Gems/2.0.0/cache/cocoapods-1.1.0.beta.2.gem

 尼玛,又是ERROR,文件路径给提示出来了,貌似是这个cache文件夹的原因,删除了这个缓存cache就行了吧,好执行.

4.删除后,再次执行第三步的操作.

Fetching: cocoapods-1.1.0.beta.2.gem (100%)

Successfully installed cocoapods-1.1.0.beta.2

Parsing documentation for cocoapods-1.1.0.beta.2

Installing ri documentation for cocoapods-1.1.0.beta.2

1 gem installed

 嘿嘿嘿,成功了.

 

转载于:https://www.cnblogs.com/liuzicheng/p/5952049.html

你可能感兴趣的:(cocoapods,ruby)