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

怎甘沉沦 提交于 2019-11-26 13:04:48

问题


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

$ 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

$ sudo gem update cocoapods

But it tells me there is nothing to update:

Password:
Updating installed gems
Nothing to update

run pod --version

but I get:

 0.31.0

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


Xcode: 5.1

ruby: 2.0.0p353

OSX: 10.9.2


回答1:


To update cocoapods just do

sudo gem install cocoapods

and then you should be at the correct version




回答2:


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

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




回答3:


To update the version you must reinstall 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:

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

Finally:

pod install



回答4:


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

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




回答5:


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.



来源:https://stackoverflow.com/questions/23165446/when-running-pod-install-i-get-the-master-repo-requires-cocoapods-0-32-1-try

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!