升級Mac os x 10.10+xcode6.1之後,Cocoapods出現問題的解決方案

來源:互聯網
上載者:User

標籤:cocoapods   ios   mac os x 10.10   xcode   

在升級Mac OS X 10.10+Xcode 6.1之後,Cocoapods的依賴庫管理也相應的進行了升級。目前最新的Release版本是 0.34。在之前的版本中,進行庫更新和管理時,會遇到如下錯誤

/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>'

解決的方案如下,開啟Terminals

1. 卸載 cocoapods

$ sudo gem uninstall cocoapods

2. 安裝 xcodeproj

$ sudo gem install xcodeproj

3. 重新安裝cocoapods
$ sudo gem install cocoapods

pod setup

4. 檢查pod 版本

pod --version

以上的命令執行過程中,如果出現紅色字或者黃色的字,說明有錯誤,需要根據實際情況檢查。

可能會遇到一個問題,在執行pod setup和 pod --version時,得到如下錯誤提示 verify_get_version

Options:    --silent              Show nothing    --completion-script   Print the auto-completion script    --version             Show the version of the tool    --verbose             Show more debugging information    --no-ansi             Show output without ANSI codes    --help                Show help banner of specified commandfrom /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.4/lib/cocoapods/command.rb:129:in `verify_git_version!'from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.4/lib/cocoapods/command.rb:48:in `run'from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.4/bin/pod:33:in `<top (required)>'from /usr/bin/pod:23:in `load'from /usr/bin/pod:23:in `<main>'

解決如下

開啟xcode->Preferences->選擇 Locaiton->在Command Line Tools中選擇 Xcode 6.1,會提示輸入sudo密碼。

完成之後,回到終端,輸入git --version,確認是否1.9版本以上

然後重新安裝上述 cocoapods的過程。

升級Mac os x 10.10+xcode6.1之後,Cocoapods出現問題的解決方案

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.