zoukankan      html  css  js  c++  java
  • osx升级到10.10后,用pod install报错最终解决办法

    转载自:http://blog.csdn.net/liuyujinglove/article/details/40582197

    http://blog.csdn.net/dqjyong/article/details/37958067
    大概步骤如下:

        Open Xcode 6
        Open Preferences
        Click theLocationstab
        Change theCommand Line Toolsversion toXcode 6.0
        Uninstallcocoapods
       

    a.$ sudo gem uninstall cocoapods

        Installxcodeproj

        a.$ sudo gem install xcodeproj

        Installcocoapods
     

     a.$ sudo gem install cocoapods
     $ pod --version

    如果你执行到第6步:sudo gem install xcodeproj 成功,但是到第七步:$ sudo gem install cocoapods时失败,错误信息如下:

    ERROR:Could not find a valid gem 'cocoapods' (>= 0), here is why:Unable to download data from https://rubygems.org/ - Errno::ETIMEDOUT: Operation timed out - connect(2) (https://rubygems.org/latest_specs.4.8.gz)ERROR:Possible alternatives: cocoapods

    意识是说在官方源中找不到我们需要的源,这时怎么办呢,网上找到一篇博客,这样做的,切换官方源,也即是改变源的获取地址

    这时候我们需要改变 gem source, 参考[4], [5]。需要在终端中执行如下命令:

    $ gem sources -l
    
    $ gem sources --remove https://rubygems.org/
    
    $ gem sources -a https://ruby.taobao.org/
    
    $ gem sources -l


    接下来输入以下命令:

    $ pod setup
    
    This processwilllikely take a while as this command clones the CocoaPods Specs repository
    
    into ~/.cocoapods/ on your computer. [6]


    至此CocoaPods安装完毕。

    注:如果漏掉 "$ pod setup" 命令,而直接执行"$ pod init"

    会有类似以下的error信息:

    $ pod init
    
    Setting up CocoaPods master repo
    
    [!] /usr/bin/git clone 'https://github.com/CocoaPods/Specs.git' master --depth=1
    
    Cloning into 'master'...
    
    error: RPC failed; result=52, HTTP code = 0
    
    fatal: The remote end hung up unexpectedly
    
    /Library/Ruby/Gems/2.0.0/gems/claide-0.6.1/lib/claide/command.rb:304:in `handle_exception': undefined method `verbose?' for nil:NilClass (NoMethodError)
    
    from /Library/Ruby/Gems/2.0.0/gems/claide-0.6.1/lib/claide/command.rb:284:in `rescue in run'
    
    from /Library/Ruby/Gems/2.0.0/gems/claide-0.6.1/lib/claide/command.rb:274:in `run'
    
    from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.33.1/lib/cocoapods/command.rb:48:in `run'
    
    from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.33.1/bin/pod:33:in `<top (required)>'
    
    from /usr/bin/pod:23:in `load'
    
    from /usr/bin/pod:23:in `<main>' "


    以上操作步骤完成后在进行:

    $ sudo gem install cocoapods


    这时就成功了!

    剩下的就是和以前的一样在工程目录下,建Podfile,执行pod install,打开xworkspace等,顺利完成!!!

    参考博客:http://www.cnblogs.com/cwgk/p/3370949.html

  • 相关阅读:
    [JavaScript]使用setTimeout减少多余事件
    Spring.NET教程(二)——环境搭建(基础篇) (转)
    IIS开启GZIP压缩效率对比及部署方法 (转)
    提高表格操作的十五款jQuery插件
    SQLServer和Oracle常用函数对比
    [hystar整理]Entity Framework 教程
    Remoting方法重载遇到的一个问题
    异变: input的背景background
    实时股票数据接口
    发现并解决ASP.NET内存耗尽(OOM),让服务器"永不重启"
  • 原文地址:https://www.cnblogs.com/allanliu/p/4173224.html
Copyright © 2011-2022 走看看