我和这篇帖子基本上有同样的问题: 当运行pod install我得到`master` repo需要CocoaPods 0.32.1,尝试更新但仍然在0.31但是答案对我没有帮助(我不允许发表评论哈哈!)

我尝试运行'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>'

然后我运行'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

即使在此之后,我运行'pod --version',我仍然得到0.31.1。 我需要采取另一个步骤来成功更新到0.32.1吗?

===============>>#1 票数:31 已采纳

更新:在sudo gem uninstall cocoapods之后需要重新启动TERMINAL

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

===============>>#2 票数:9

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

===============>>#3 票数:4

尝试首先卸载gem:

sudo gem uninstall cocoapods

然后再次安装:

sudo gem install cocoapods

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

===============>>#4 票数:1

对我来说,问题是由安装了两个版本的cocoapods引起的。

我首先通过运行sudo gem uninstall cocoapods

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

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

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

===============>>#5 票数:1

我正在使用捆绑包,所以bundle update cocoapods适合我。

===============>>#6 票数:0

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

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

还有,更好的复制粘贴,容易用Cocoapods打错字:-)

  ask by EAB translate from so

未解决问题?本站智能推荐: