如何使 CocoaPods 项目在 OS X El Capitan 和 Xcode 7 Beta 上运行?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/30721061/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 07:15:16  来源:igfitidea点击:

How to make a CocoaPods project work on OS X El Capitan & Xcode 7 Beta?

xcodexcode7osx-elcapitan

提问by Kris Haamer

I've updated to OS X El Capitan & Xcode 7 Beta released today and now my CocoaPods projects no longer work because of the new Swift syntax requirements. The automated Xcode project update breaks the code. Has anyone already figured this out already? Thanks.

我已经更新到今天发布的 OS X El Capitan 和 Xcode 7 Beta,现在由于新的 Swift 语法要求,我的 CocoaPods 项目不再工作。自动 Xcode 项目更新破坏了代码。有没有人已经想到了这一点?谢谢。

采纳答案by Marius Kjeldahl

Until Cocoapods supports Swift 2, at the very least you should be able to continue to use Xcode 6 until it does. If Xcode 7 has stomped all over your Cocoapods already, this link shows you how to clean it up https://gist.github.com/mbinna/4202236.

在 Cocoapods 支持 Swift 2 之前,至少您应该能够继续使用 Xcode 6,直到它支持为止。如果 Xcode 7 已经覆盖了你的 Cocoapods,这个链接会告诉你如何清理它https://gist.github.com/mbinna/4202236

Basically, from inside any project using Cocoapods:

基本上,从任何使用 Cocoapods 的项目内部:

rm -rf "${HOME}/Library/Caches/CocoaPods"
rm -rf "`pwd`/Pods/"
pod update

Then rebuild using Xcode 6 and everything should be back to normal.

然后使用 Xcode 6 重建,一切都应该恢复正常。

回答by huync

It worked for me for the bug when run Cocoapods on El Capitan 10.11 following this guide:

按照本指南在 El Capitan 10.11 上运行 Cocoapods 时,它对我有用:

export GEM_HOME=$HOME/.gem
export PATH=$GEM_HOME/bin:$PATH

gem install cocoapods

回答by Steffen Brem

I did this to make it work for me:

我这样做是为了让它对我有用:

brew install ruby
/usr/local/bin/gem install cocoapods

回答by StackRunner

Disabling system integrity protection worked for me.

禁用系统完整性保护对我有用。

Follow these steps to disable SIP:

请按照以下步骤禁用 SIP:

Restart your Mac. Before OS X starts up, hold down Command-R and keep it held down until you see an Apple icon and a progress bar. Release. This boots you into Recovery. From the Utilities menu, select Terminal. At the prompt type exactly the following and then press Return: csrutil disable Terminal should display a message that SIP was disabled. From the ? menu, select Restart

重新启动您的 Mac。在 OS X 启动之前,按住 Command-R 并保持按住直到看到 Apple 图标和进度条。释放。这将引导您进入恢复。从实用程序菜单中,选择终端。在提示符下准确键入以下内容,然后按回车键: csrutil disable Terminal 应显示一条消息,指出 SIP 已禁用。来自 ?菜单,选择重新启动