【问题标题】:Cocoapods - 'pod --version' gives me 0.31.1 after updating to 0.32.1Cocoapods - 'pod --version' 在更新到 0.32.1 后给了我 0.31.1
【发布时间】:2014-06-04 07:44:58
【问题描述】:

我的问题与这篇文章基本相同:when running pod install I get The `master` repo requires CocoaPods 0.32.1, try updating but still in 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?

【问题讨论】:

    标签: xcode gem cocoapods


    【解决方案1】:

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

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

    【讨论】:

    • 显示错误:ERROR: While executing gem ... (Errno::EPERM) Operation not permitted - /usr/bin/xcodeproj - 这个问题的解决方案是什么?
    【解决方案2】:

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

    【讨论】:

    • 谢谢,我必须同时运行“gem uninstall cocoapods”和“sudo gem uninstall cocoapods”才能让它工作
    【解决方案3】:

    先尝试卸载 gem:

    sudo gem uninstall cocoapods
    

    然后重新安装:

    sudo gem install cocoapods
    

    那么pod --version 应该显示最新的。

    【讨论】:

    • 忘了说我也试过好几次了。我需要在某个目录中安装或卸载吗?我在我的 xcode 项目目录中执行这些命令,但我怀疑这很重要。
    • 是的,这不重要。如果您仍然无法使其正常工作,我会尝试通过 RVM 或 rbenv 等设置 ruby​​。
    • 是的,我正在使用 rbenv.. 重新启动终端解决了卸载后的问题。
    • 哦,使用 rbenv 你不应该使用sudo。还要确保在每个这些之后运行rbenv rehash
    【解决方案4】:

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

    【讨论】:

    • 这对我有帮助!我被困在 cocoapods 1.10.0 上,但是在更新它时一直说已经在 1.10.1 中。无论如何,那个命令救了我。谢谢
    【解决方案5】:

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

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

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

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

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

    【讨论】:

      【解决方案6】:

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

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

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

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2014-06-05
        • 1970-01-01
        • 2019-07-14
        • 2021-01-21
        • 2020-03-19
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多