简体   繁体   English

如何在 Mac Sierra 中为 Xcode 项目初始化 pod

[英]How to init pod for Xcode project in Mac Sierra

I've updated my Mac to latest Mac Sierra version.我已将 Mac 更新到最新的 Mac Sierra 版本。 Now, I'm facing a problem with my Xcode project (Xcode 8).现在,我的 Xcode 项目 (Xcode 8) 遇到了问题。 I cannot run "pod init" (pod install and pod update is working fine with old project).我无法运行“pod init”(pod 安装和 pod 更新在旧项目中运行良好)。

The terminal shows this error :终端显示此错误:

Les-MacBook-Pro:testPod victory1908$ pod init
/Library/Ruby/Site/2.0.0/rubygems.rb:270:in `find_spec_for_exe': can't find gem cocoapods (>= 0.a) (Gem::GemNotFoundException)
    from /Library/Ruby/Site/2.0.0/rubygems.rb:298:in `activate_bin_path'
    from /usr/local/bin/pod:22:in `<main>'
Les-MacBook-Pro:testPod victory1908$ 

What is this, and how can we init pod for a Xcode project in Mac Sierra?这是什么,我们如何为 Mac Sierra 中的 Xcode 项目初始化 pod?

I faced the same issue with macOS 10.12.5... As a result, I fixed it performing following commands on terminal:我在 macOS 10.12.5 上遇到了同样的问题......因此,我修复了它在终端上执行以下命令:

sudo gem install activesupport -v 4.2.6
sudo gem install cocoa pods

It could be that you just have to update your ruby version to the latest and then install cocoapods gem and then all should be well.可能是您只需将 ruby​​ 版本更新到最新版本,然后安装 cocoapods gem,然后一切都会好起来的。 How to update your ruby version has been answered here: https://stackoverflow.com/a/38194139/7451779如何更新您的 ruby​​ 版本已在此处回答: https : //stackoverflow.com/a/38194139/7451779

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM