ios - CocoaPods 报错
巴扎黑
巴扎黑 2017-04-17 13:14:28
0
1
234

weifansdeMacBook-Pro:CocoaPodsTest weifans$ pod install
fatal: Not a git repository (or any of the parent directories): .git
fatal: Not a git repository (or any of the parent directories): .git
fatal: Not a git repository (or any of the parent directories): .git
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.4/lib/cocoapods/user_interface/error_report.rb:13:in report': incompatible character encodings: UTF-8 and ASCII-8BIT (Encoding::CompatibilityError) from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.4/lib/cocoapods/command.rb:63:inreport_error'
from /Library/Ruby/Gems/2.0.0/gems/claide-0.7.0/lib/claide/command.rb:300:in handle_exception' from /Library/Ruby/Gems/2.0.0/gems/claide-0.7.0/lib/claide/command.rb:274:inrescue in run'
from /Library/Ruby/Gems/2.0.0/gems/claide-0.7.0/lib/claide/command.rb:264:in run' from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.4/lib/cocoapods/command.rb:50:inrun'
from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.4/bin/pod:33:in <top (required)>' from /usr/bin/pod:23:inload'
from /usr/bin/pod:23:in `'
weifansdeMacBook-Pro:CocoaPodsTest weifans$

好多方法都试过了不管用

Ruby Version:
weifansdeMacBook-Pro:CocoaPodsTest weifans$ ruby -v
ruby 2.0.0p481 (2014-05-08 revision 45883) [universal.x86_64-darwin14]

CocoaPods Version:
weifansdeMacBook-Pro:CocoaPodsTest weifans$ pod --version
0.34.4

求大神:ˊ_>ˋ

巴扎黑
巴扎黑

全部回覆(1)
PHPzhong

看了一下題主的Podfile,是老的寫法,cocoapods 0.34以後換新的寫法了:

# platform :ios, '7.0'

target "Apptarget" do
    pod "Reachability", "~> 3.0.0"
    pod "SBJson", "~> 4.0.0"
    pod "AFNetworking', '~> 2.0"
end

用上面這個新的寫法試一試吧,其中引號裡的Apptarget請替換成你的App編譯的那個target,一般就是你建立App工程的名稱(其單元測試target,就是在這個後面多了Tests這個後綴,注意不要搞錯)。


更新

之前的程式碼裡面加了一句source 'master', Cocoapods 0.34正式版以後source指令用來建立自己的podspec庫,如果不希望把自己的程式碼註冊為一個podspec,可以不用這個指令。但是隱式來源已經被deprecate掉了,所以為了相容以後的cocoapods版本,需要在前面加上source 'https://github.com/CocoaPods/Specs.git'。這個repo是Cocoapods官方維護的Spec repo。

熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!