美文网首页
CocoaPods版本升级的坑

CocoaPods版本升级的坑

作者: 疯狂的向日葵 | 来源:发表于2016-12-16 17:28 被阅读65次

    终端进入项目目录执行pod install:

    $ pod install
    Analyzing dependencies
    [!] The version of CocoaPods used to generate the lockfile (1.0.0) is higher than the version of the current executable (0.39.0). Incompatibility issues may arise.
    

    因此我们需要更新cocoapods,执行下面的命令,但是并没有更新成功。

    $ gem update cocoapod
    Updating installed gems
        
    Nothing to update
    

    查看当前版本:

    $ pod --version
        
    0.39.0
    

    怀疑source地址有变化:

    $ gem sources -l
    *** CURRENT SOURCES ***
       
        
    http://ruby.taobao.org/
    

    网上查看,改为Ruby China的 http://gems.ruby-china.org,因此执行如下:

    $ gem sources -r http://ruby.taobao.org/
    http://ruby.taobao.org/ removed from sources
     
    $ gem sources -a http://gems.ruby-china.org
    https://ruby.taobao.org/ added to sources
    

    更新系统,提示没有权限:

    $ gem update --system 
    Updating rubygems-update
    Fetching: rubygems-update-2.5.1.gem (100%)
    ERROR:  While executing gem ... (Gem::FilePermissionError)
        
        You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.
    

    使用sudo来执行操作:

    $ sudo gem update --system
    Updating rubygems-update
    Fetching: rubygems-update-2.5.1.gem (100%)
    Successfully installed rubygems-update-2.5.1
        
    Parsing documentation for rubygems-update-2.5.1
    

    执行安装:
    依旧特么报错

    $ pod setup
    Setting up CocoaPods master repo
    [!] The `master` repo requires CocoaPods 1.0.0 -  (currently using 0.39.0)
    Update CocoaPods, or checkout the appropriate tag in the repo.
    

    必须得升级cococPods...
    恩 网上找到了这一大串命令

    $ sudo gem install -n /usr/local/bin cocoapods --pre
    
    //输入密码
    Password:
    Successfully installed xcodeproj-1.4.1
    Fetching: ruby-macho-0.2.6.gem (100%)
    Successfully installed ruby-macho-0.2.6
    Fetching: molinillo-0.5.4.gem (100%)
    Successfully installed molinillo-0.5.4
    Fetching: gh_inspector-1.0.2.gem (100%)
    ...
    

    再重新查看pods版本

    $ pod --version
    

    再清理一下

    $ pod repo upadte --verbose
    
    $ rm -rf ~/.cocoapods/repos/master
    

    再重新运行:

    $ pod setup
    Setting up CocoaPods master repo
    

    相关文章

      网友评论

          本文标题:CocoaPods版本升级的坑

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