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:in
report_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:in
rescue 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: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 `'
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
求大神:ˊ_>ˋ
看了一下題主的Podfile,是老的寫法,cocoapods 0.34以後換新的寫法了:
用上面這個新的寫法試一試吧,其中引號裡的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。