提高Mac os x 10.10+xcode6.1以後,Cocoapods發生故障的解決方案

提高Mac OS X 10.10+Xcode 6.1以後。Cocoapods圖書館管理也依賴於相應升級。如今最新的Release版本號是 0.34。在以前的版本號。當數據庫更新和管理,你會遇到一個錯誤,以下面的git

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

2. 安裝 xcodeprojruby

$ sudo gem install xcodeprojui

3. 又一次安裝cocoapods
$ sudo gem install cocoapodsdebug

pod setup
code

4. 檢查pod 版本號
orm

pod --versionblog

以上的命令運行過程當中。假設出現紅色字或者黃色的字,說明有錯誤,需要依據實際狀況檢查。ip

可能會遇到一個問題,在運行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 command
	from /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,會提示輸入sudopassword。

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

而後又一次安裝上述 cocoapods的過程。

相關文章
相關標籤/搜索