xcode Cocoapods - 'pod --version' 在更新到 0.32.1 后给我 0.31.1

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/23177155/
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 04:53:16  来源:igfitidea点击:

Cocoapods - 'pod --version' gives me 0.31.1 after updating to 0.32.1

xcodegemcocoapods

提问by EAB

I have basically the same question as this post: when running pod install I get The `master` repo requires CocoaPods 0.32.1, try updating but still in 0.31but the answer doesn't help me (I'm not allowed to comment on things yet haha!)

我有与这篇文章基本相同的问题:运行 pod install 时,我得到“master”repo 需要 CocoaPods 0.32.1,尝试更新但仍在 0.31 中但答案对我没有帮助(我不允许评论事情还没有哈哈!)

I try to run 'pod install' or 'pod setup' and I get an error saying:

我尝试运行“pod install”或“pod setup”,但收到一条错误消息:

[!] The `master` repo requires CocoaPods 0.32.1 - 
Update CocoaPods, or checkout the appropriate tag in the repo.
/Library/Ruby/Gems/2.0.0/gems/claide-0.5.0/lib/claide/command.rb:281:in `rescue in run': undefined method `verbose?' for nil:NilClass (NoMethodError)
    from /Library/Ruby/Gems/2.0.0/gems/claide-0.5.0/lib/claide/command.rb:274:in `run'
    from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.31.1/lib/cocoapods/command.rb:51:in `run'
    from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.31.1/bin/pod:33:in `<top (required)>'
    from /usr/bin/pod:23:in `load'
    from /usr/bin/pod:23:in `<main>'

Then I run 'sudo gem install cocoapods' and I get:

然后我运行'sudo gem install cocoapods',我得到:

CHANGELOG:

## 0.32.1

##### Bug Fixes

* Fixed the Podfile `default_subspec` attribute in nested subspecs.  
  [Fabio Pelosin][irrationalfab]
  [#2050](https://github.com/CocoaPods/CocoaPods/issues/2050)


Successfully installed cocoapods-0.32.1
Parsing documentation for cocoapods-0.32.1
Done installing documentation for cocoapods after 1 seconds
1 gem installed

Even after this, I run 'pod --version' and I still get 0.31.1. Is there another step I need to take to successfully update to 0.32.1?

即使在此之后,我运行 'pod --version' 仍然得到 0.31.1。我是否还需要采取其他步骤才能成功更新到 0.32.1?

回答by EAB

Update: HAD TO RESTART TERMINAL after sudo gem uninstall cocoapods

更新:之后必须重新启动终端 sudo gem uninstall cocoapods

Then sudo gem install cocoapodsupdates to the latest version successfully.

然后sudo gem install cocoapods成功更新到最新版本。

回答by James Martin

Run pod --versionand sudo pod --version- I imagine multiple versions have been installed with and without sudo. Either update both, or remove the undesired second one with [sudo] gem uninstall cocoapods

运行pod --versionsudo pod --version- 我想已经安装了多个版本,有和没有 sudo。要么更新两者,要么删除不需要的第二个[sudo] gem uninstall cocoapods

回答by Keith Smiley

Try uninstalling the gem first:

首先尝试卸载 gem:

sudo gem uninstall cocoapods

Then install it again:

然后再次安装:

sudo gem install cocoapods

Then pod --versionshould show the newest.

然后pod --version应该显示最新的。

回答by bjrara

For me, the problem is caused by two versions of cocoapods have been installed.

对我来说,问题是因为安装了两个版本的 cocoapods。

I uninstalled cocoapods first by running sudo gem uninstall cocoapods.

我首先通过运行卸载了 cocoapods sudo gem uninstall cocoapods

And then run pod --versioncommand to check the existence of cocoapods again.

然后运行 pod --version命令再次检查 cocoapods 的存在。

Wierd thing happened! The gem is there. So I uninstalled cocoapods for the second time.

奇怪的事情发生了!宝石就在那里。所以我第二次卸载了cocoapods。

My conclusion is to make sure you delete all cocoapods completely, and reinstall it. It works for me.

我的结论是确保您完全删除所有 cocoapods,然后重新安装它。这个对我有用。

回答by Muzammil

I am using bundle, so bundle update cocoapodsworks for me.

我正在使用捆绑包,所以bundle update cocoapods对我有用。

回答by Naishta

What finally worked for me was...

最终对我有用的是......

- sudo gem uninstall cocoapods
- Restart the Terminal ( on your Mac)
- sudo gem install cocoapods --source http://rubygems.org

also , better copy paste, easy to do a typo with Cocoapods :-)

另外,更好的复制粘贴,使用 Cocoapods 很容易打错字 :-)