標籤: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出現問題的解決方案