cocoapods重装踩坑记录

作者: JeffreyTaiT | 来源:发表于2018-08-01 15:56 被阅读5次

            因为重装了系统,所以cocoapods也要重新装,所以记录下遇到的坑,真的是坑。网上找了很多资料,含泪弄了好几天。。发觉网上资料有些都过时了,所以自己整理下。

    [!] Error installing SDWebImage[!] /usr/bin/git clone https://github.com/rs/SDWebImage.git /var/folders/pd/stntxywd0jx1fvws8fhj41tw0000gn/T/d20180727-6706-60dyxb --template= --single-branch --depth 1 --branch 4.0.0Cloning into '/var/folders/pd/stntxywd0jx1fvws8fhj41tw0000gn/T/d20180727-6706-60dyxb'...error: RPC failed; curl 56 LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54fatal: The remote end hung up unexpectedlyfatal: early EOFfatal: index-pack failed

    这个坑是因为pod install遇到,最后知道因为我开了vpn,关掉再pod install就可以了。。


    [!] Error installing MBProgressHUD[!] /usr/bin/git clone https://github.com/matej/MBProgressHUD.git /var/folders/pd/stntxywd0jx1fvws8fhj41tw0000gn/T/d20180801-15423-eucoy0 --template= --single-branch --depth 1 --branch 1.0.0Cloning into '/var/folders/pd/stntxywd0jx1fvws8fhj41tw0000gn/T/d20180801-15423-eucoy0'...error: RPC failed; curl 56 LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 60fatal: The remote end hung up unexpectedly

    执行$:xcode-select -p,打印结果如下:/Applications/Xcode.app/Contents/Developer,再执行$:sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer


    [!] CocoaPods could not find compatible versions for pod "Masonry":  In Podfile:    Masonry (~> 1.1.0)None of your spec sources contain a spec satisfying the dependency: `Masonry (~> 1.1.0)`.You have either: * out-of-date source repos which you can update with `pod repo update` or with `pod install --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.

    这个坑是clone的一个项目,然后执行pod install遇到。主要还是~/.cocoapods/repos文件下的master的问题,可以执行pod setup,不过我从没成功过,所以要Git clone https://git.coding.net/CocoaPods/Specs.git ~/.cocoapods/repos/master,或者下载好master文件(这个文件好大坨的)然后移动到~/.cocoapods/repos下。

    [!] CocoaPods could not find compatible versions for pod "Masonry":   In snapshot (Podfile.lock):     Masonry (= 1.1.0, ~> 1.1.0)   In Podfile:     Masonry (~> 1.1.0) None of your spec sources contain a spec satisfying the dependencies: `Masonry (~> 1.1.0), Masonry (= 1.1.0, ~> 1.1.0)`. You have either:  * out-of-date source repos which you can update with `pod repo update` or with `pod install --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.

    这个也是clone来的项目执行pod install的,把.xcworkspace和Podfile.lock文件删除,重新pod install一下就好了。猜测是不是不通版本或者系统造成的。


    [!] Error installing SDWebImage [!] /usr/bin/git clone https://github.com/rs/SDWebImage.git /var/folders/pd/stntxywd0jx1fvws8fhj41tw0000gn/T/d20180801-17253-133nbmi --template= --single-branch --depth 1 --branch 3.8.2 Cloning into '/var/folders/pd/stntxywd0jx1fvws8fhj41tw0000gn/T/d20180801-17253-133nbmi'... fatal: unable to access 'https://github.com/rs/SDWebImage.git/': LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54

    这是在执行pod install之后发生的,解决办法:sudo gem install cocoapods,接着再pod install,就成功了。


    git clone early EOF error

    git config --global core.compression -1


    fatal: The remote end hung up unexpectedly

    将http.postBuffer设置的尽量大,例如git config --global http.postBuffer 524288000  (500M)

    git config --global http.postBuffer 1048576000  (1G)


    ERROR: Error installing cocoapods: activesupport requires Ruby version >= 2.2.2.

    更新ruby


    ERROR: While executing gem … (Errno::EPERM) Operation not permitted - /usr/bin/xcodeproj

    sudo gem install -n /usr/local/bin cocoapods


    顺便贴一点可能用到的命令:

    Mac os 11以后的话安装cocoapods

    $ sudo gem install -n /usr/local/bin cocoapods

    cocoapods master移除:

    $ sudo rm -fr ~/.cocoapods/repos/master 

    替代pod setup:

    $ git clone https://git.coding.net/CocoaPods/Specs.git  ~/.cocoapods/repos/master

    $ pod repo update

    pod安装与否查询(1为安装成功,0为不成功)

    $ pod repo list 

    清空全局缓存

    $ sudo rm -fr ~/Library/Caches/CocoaPods/

    $ sudo rm -fr ~/.cocoapods/repos/master/

    $ sudo rm -fr Pods/

    待补充...

    因为是事后才记录的,所以有些坑没有截图或者文字记录了,还有的解决完忘记记录,甚至可能有遗漏和错误。。。希望有道友可以评论补充以帮助更多踩坑人~


    其他大佬踩坑记录:

    使用cocoaPods时出现一些问题的解决方法

    CocoaPods安装、卸载、使用说明(Mac ox 10.11+)

    cocoapods:常见错误总结

    rvm、Ruby环境和CocoaPods安装使用及相关报错问题解决

    解决CocoaPods各种慢的方案(gem换源+pod repo换源)

    cocoapod重装的话参考链接:

    2017/10/1更新之MAC安装CocoaPods流程详解

    cocopods彻底卸载重新安装

    cocoapods 卸载,重装,高版本的使用

    温馨提醒,可以不用完全按照步骤,比如ruby已经装了且是最新的了,就没必要再去重装更新了。

    相关文章

      网友评论

        本文标题:cocoapods重装踩坑记录

        本文链接:https://www.haomeiwen.com/subject/yqvgmftx.html