今天執行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
嘿嘿嘿,成功了.