xcode Pod 文件没有被初始化?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/41996429/
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
Pod file not being initialized?
提问by Usama bin Attique
When i try to initialize pod file to use cocoapods
via terminal, it gives me this error. How to fix it.
当我尝试初始化 pod 文件以cocoapods
通过终端使用时,它给了我这个错误。如何修复它。
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.2.0/lib/cocoapods/command.rb:128:in `verify_minimum_git_version!': [!] You need at least git version 1.8.5 to use CocoaPods (Pod::Informative)
回答by Guohua Cheng
I encounter the same problem and solve it by using the following command:
我遇到了同样的问题并使用以下命令解决了它:
sudo xcode-select --switch /Applications/Xcode.app
As the error message in terminal
shows, something with my git
goes wrong. And, it has to do with the command line tool.
正如中的错误消息terminal
所示,我git
的出了点问题。而且,它与命令行工具有关。
回答by Joyal Clifford
I was having an issue while trying to install packages using cocoapods. I have tried "sudo xcode-select --switch /Applications/Xcode.app"
still getting wrong path error
我在尝试使用 cocoapods 安装软件包时遇到问题。我试过 "sudo xcode-select --switch /Applications/Xcode.app"
仍然得到错误的路径错误
To fix this
要解决这个问题
I opened Xcode.
我打开了Xcode。
Preferences
Locations
Selected the Command Lin Tools: Xcode 9.0
Now when installing packages with cocoapods I no longer get errors.
现在,当使用 cocoapods 安装软件包时,我不再出错。
回答by Krunal
You need to set command line tool version, in Xcode:
您需要在 Xcode 中设置命令行工具版本:
You can download latest command line tool from Apple Download Portal, if you have paid apple developer account/id.
如果你已经支付了苹果开发者账号/id,你可以从苹果下载门户下载最新的命令行工具。
Here are current beta and stable Xcode Tool and supporting command line tool download link. (Ensure you'are logged in using premium developer account on Apple Developer Account to access these links)
这是当前测试版和稳定版的 Xcode 工具以及支持的命令行工具下载链接。(确保您使用 Apple Developer Account 上的高级开发者帐户登录以访问这些链接)
Xcode 11
Xcode 10
Xcode 10.2.1
- (Command Line Tool (Xcode 10.2.1) - for macOS 10.14)Xcode 10.2
- (Command Line Tool (Xcode 10.2) - for macOS 10.14)Xcode 10.1
- (Command Line Tool (Xcode 10.1) - for macOS 10.14)
- (Command Line Tool (Xcode 10.1) - for macOS 10.13)Xcode 10
- (Command Line Tool (Xcode 10) - for macOS 10.14)
- (Command Line Tool (Xcode 10) - for macOS 10.13)
Xcode 11
Xcode 10
Once you've latest command line tool installed in your system, set it from Xcode Menu.
在系统中安装最新的命令行工具后,从 Xcode 菜单设置它。
(Xcode Menu Items) Xcode ? Preferences ? Location ? Command Line Tool ? Select appropriate command line tool
(Xcode 菜单项) Xcode ? 喜好 ?地点 ?命令行工具 ? 选择合适的命令行工具
回答by FBC
After installing OS Mojaveand installed new Xcode tools i just had to check again the tools in:
安装OS Mojave并安装新的 Xcode 工具后,我只需要再次检查以下工具:
Xcode > Preferences > Locations > Command Line tools = Xcode 10.0
Xcode > 首选项 > 位置 > 命令行工具 = Xcode 10.0
回答by Sandy D.
If you have upgraded your MAC from the App Store, then you need to run: xcode-select --install
如果你已经从 App Store 升级了你的 MAC,那么你需要运行:xcode-select --install
When I ran git --versionbefore running the command above, it didn't find git at all. It displayed this error: missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun. So, I'm guessing when I upgraded my machine somehow I lost git. Regardless, running the above command worked.
当我在运行上面的命令之前运行git --version 时,它根本没有找到 git 。它显示了这个错误:missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun。所以,我猜当我以某种方式升级我的机器时,我丢失了 git。无论如何,运行上述命令是有效的。
I then ran git --version and it showed the git version that was installed.
然后我运行 git --version 并显示已安装的 git 版本。
参考:http : //tips.tutorialhorizon.com/2015/10/01/xcrun-error-invalid-active-developer-path-library-developer-commandline-tools-missing-xcrun/
回答by Shankar Saran Singh
Sometimes its version issue.
有时它的版本问题。
Installing CoacoaPods 1.7.5 did the trick.
安装 CoacoaPods 1.7.5 就成功了。
sudo gem uninstall cocoapods
sudo gem install cocoapods -v 1.7.5
pod setup
回答by Ibrahim Su?i?
I fixed the problem with next steps:
我通过接下来的步骤解决了这个问题:
sudo gem install cocoapods --source http://rubygems.org
after command finish entering new command
命令完成后输入新命令
pod install
and work for me on xCode 11.2
并在 xCode 11.2 上对我来说有效
回答by Waaheeda
Hey this might help you!!! I followed this link
嘿,这可能对你有帮助!!!我跟着这个链接
https://stackoverflow.com/a/16664135/7905401
https://stackoverflow.com/a/16664135/7905401
After installing command line tools i closed it and opened terminal again now when i checked version git --version it gave me update version 2.10.0 then i ran other commands for cocoapod!! its working!!!!!!!!! yeeeii!!!!
安装命令行工具后,我关闭它并再次打开终端,当我检查版本 git --version 它给我更新版本 2.10.0 然后我为 cocoapod 运行其他命令!它的工作!!!!!!!!!耶!!!!
回答by Waaheeda
I followed this
我跟着这个
After installing command line tools, I closed it and opened terminal again. Now when I checked version git --version
, it gave me update version 2.10.0then I ran other commands for cocoapod.
安装命令行工具后,我关闭它并再次打开终端。现在,当我检查版本时git --version
,它给了我更新版本2.10.0然后我为cocoapod运行了其他命令。
Now it is working.
现在它正在工作。