• 升级10.10 Yosemite 后,cocoapods 出现错误(解决方案)


    RSMacBook-Pro:~ RS$ pod search jsonkit
    /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- xcodeproj/prebuilt/universal.x86_64-darwin14-2.0.0/xcodeproj_ext (LoadError)
        from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /Library/Ruby/Gems/2.0.0/gems/xcodeproj-0.17.0/lib/xcodeproj/ext.rb:6:in `rescue in <top (required)>'
        from /Library/Ruby/Gems/2.0.0/gems/xcodeproj-0.17.0/lib/xcodeproj/ext.rb:3:in `<top (required)>'
        from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /Library/Ruby/Gems/2.0.0/gems/xcodeproj-0.17.0/lib/xcodeproj.rb:30:in `<top (required)>'
        from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.33.1/lib/cocoapods.rb:2:in `<top (required)>'
        from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.33.1/bin/pod:32:in `<top (required)>'
        from /usr/bin/pod:23:in `load'
        from /usr/bin/pod:23:in `<main>'
    

     一直想尝试新系统,由于担心bug会导致开发遇到一系列问题,一直忍住没有升级,前两天升级了,就立刻遇到这个问题。

    无法对cocoapods进行操作,stackoverflow上有个解决方案,被多人转载,可惜didn't work for me. 于是我试着重新安装ruby,解决了

    方案一:(适用于大多数人)

    Open Xcode 6 打开Xcode 6 —— 系统偏好设置 —— 位置 —— 把命令行工具改为Xcode 6.0

    卸载 cocoapods —— 重新安装 xcodeproj —— 重新安装 cocoapods

    $ sudo gem uninstall cocoapods

    $ sudo gem install xcodeproj

    $ sudo gem install cocoapods
    如果没有问题,运行pod --version 查看安装是否成功

    如果,不幸的是,上述操作无法解决,就要和楼主一样了

    1.更新rbenv        

    $ curl -L get.rvm.io | bash -s stable

    2.重新安装ruby

    $ rvm install ruby 2.1.1

    3.重新安装cocoapods

    $ sudo gem install cocoapods

  • 相关阅读:
    【linux高级程序设计】(第八章)进程管理与程序开发 3
    【linux高级程序设计】(第八章)进程管理与程序开发 2
    【linux高级程序设计】(第八章)进程管理与程序开发 1
    【linux高级程序设计】(第七章)终端及串口编程 未完成
    【剑指offer】数值的整数次方
    【剑指offer】二进制中1的个数
    【剑指offer】替换空格
    Android 最新控件 Toolbar
    IE 扩展调用主窗体中的函数
    JAVA程序设计(12.3)---- 监听器0基础应用:五子棋
  • 原文地址:https://www.cnblogs.com/sparks/p/3989044.html
Copyright © 2020-2023  润新知