ios 运行 pod install 时,我得到 `master` repo 需要 CocoaPods 0.32.1,尝试更新但仍在 0.31

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

when running pod install I get The `master` repo requires CocoaPods 0.32.1, try updating but still in 0.31

iosxcodecocoapods

提问by juan Isaza

Iam trying to install cocoa pods in a xcode project, but when doing:

我正在尝试在 xcode 项目中安装可可豆荚,但是在执行以下操作时:

$ pod install

I get the following error:

我收到以下错误:

Setting up CocoaPods master repo
[!] 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)

So I updated cocoapods

所以我更新了 cocoapods

$ sudo gem update cocoapods

But it tells me there is nothing to update:

但它告诉我没有什么可更新的:

Password:
Updating installed gems
Nothing to update

run pod --version

运行 pod --version

but I get:

但我得到:

 0.31.0

What could it be? Why it is not updating to the latest version (.32.1)?

会是什么呢?为什么它没有更新到最新版本(.32.1)?



Xcode: 5.1

代码:5.1

ruby: 2.0.0p353

红宝石:2.0.0p353

OSX: 10.9.2

OSX:10.9.2

回答by Pete42

To update cocoapods just do

要更新 cocoapods 只需执行

sudo gem install cocoapods

and then you should be at the correct version

然后你应该在正确的版本

回答by Yas T.

This is what worked for me.

这对我有用。

  1. Uninstall CocoaPods (choose to uninstall all versions):

    sudo gem uninstall cocoapods

  2. Remove old master repo:

    sudo rm -fr ~/.cocoapods/repos/master

  3. Install CocoaPods without sudo:

    gem install --user-install cocoapods

  4. Setup CocoaPods and Master repo:

    pod setup

  1. 卸载 CocoaPods(选择卸载所有版本):

    sudo gem uninstall cocoapods

  2. 删除旧的主仓库:

    sudo rm -fr ~/.cocoapods/repos/master

  3. 安装 CocoaPods 没有sudo

    gem install --user-install cocoapods

  4. 设置 CocoaPods 和 Master repo:

    pod setup

NOTE: Step 3 is going to make sure you install pod under your user name instead of root which sudodoes.

注意:第 3 步将确保以您的用户名而不是 root 安装 pod sudo

回答by joserock85

To update the version you must reinstall cocoapods:

要更新版本,您必须重新安装 cocoapods:

sudo gem install cocoapods

The next step is You are going to Have to manually delete any copies of the Specs Local repository and re-clone the new version of the repository Specs. You can do that With the Following commands:

下一步是您将不得不手动删除 Specs Local 存储库的任何副本并重新克隆存储库 Specs 的新版本。您可以使用以下命令执行此操作:

sudo rm -fr ~/.cocoapods/repos/master
pod setup

Finally:

最后:

pod install

回答by fannt

that's what worked for me:

这对我有用:

  1. Uninstall CocoaPods (choose to uninstall all versions):

    sudo gem uninstall cocoapods

  2. Remove old master repo:

    sudo rm -fr ~/.cocoapods/repos/master

  3. Update gems as user installed:

    sudo gem update --system --user-install

  4. Add local gem path:

    echo 'export PATH="$PATH:/Users/%username%/.gem/ruby/2.0.0/bin"' >> ~/.bash_login

  5. Install CocoaPods without sudo:

    gem install --user-install cocoapods

  6. Setup CocoaPods and Master repo:

    pod setup

  1. 卸载 CocoaPods(选择卸载所有版本):

    sudo gem uninstall cocoapods

  2. 删除旧的主仓库:

    sudo rm -fr ~/.cocoapods/repos/master

  3. 以用户安装的身份更新 gems:

    sudo gem update --system --user-install

  4. 添加本地宝石路径:

    echo 'export PATH="$PATH:/Users/%username%/.gem/ruby/2.0.0/bin"' >> ~/.bash_login

  5. 安装 CocoaPods 没有sudo

    gem install --user-install cocoapods

  6. 设置 CocoaPods 和 Master repo:

    pod setup

make sure you are not running no-sudo commands from sudo terminal window/tab and relaunch or add new tap after exporting path

确保您没有从 sudo 终端窗口/选项卡运行 no-sudo 命令,并在导出路径后重新启动或添加新的 Tap

回答by EAB

I had the same issue. I tried

我遇到过同样的问题。我试过

sudo gem uninstall cocoapods

and then

进而

sudo gem install cocoapods

but it wasn't working. It finally worked when I restarted Terminal after the uninstall. Then the install worked.

但它不起作用。当我卸载后重新启动终端时,它终于起作用了。然后安装工作。