我已经尝试过以下步骤:

  • 打开Xcode 6打开首选项
  • 单击“位置”选项卡
  • 将命令行工具版本更改为Xcode 6.0
  • 卸载cocoapods
  • $ sudo gem卸载cocoapods安装xcodeproj
  • $ sudo gem install
  • xcodeproj安装cocoapods
  • $ sudo gem install cocoapods
  • 运行pod --version以验证它是否起作用

  • 但是当我执行pod install或pod --version时,我仍然得到这个:
    /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>'
    

    最佳答案

    如果有人遇到相同的问题,我可以这样做来解决我的问题:

  • 更新 gem
    sudo gem update --system
  • 卸载xcodeproj
    sudo gem uninstall xcodeproj
  • 确保选择所有版本
  • 卸载的Cocoapods
    sudo gem uninstall cocoapods
  • 安装xcodeproj
    sudo gem install xcodeproj
  • 安装cocoapods
    sudo gem install cocoapods
  • 运行
    pod --version to test.
  • 关于ruby - 无法上类CocoaPods和优胜美地,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/25165016/

    10-13 08:57