CocoaPods 报错

发布于 2022-08-29 22:39:57 字数 1518 浏览 10 评论 0

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

求大神:ˊ_>ˋ

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

女尤 2022-09-05 22:39:57

看了一下题主的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。

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文