Updating to latest version of CocoaPods?

前端 未结 12 1881
误落风尘
误落风尘 2020-12-07 07:46

I\'m having some issues installing Alamofire 4.0 into my project.

I\'ve got the latest version of Xcode, running Swift 3

相关标签:
12条回答
  • 2020-12-07 08:11

    I tried updating and didn't work. Finally , I had to completely remove (manually )cocoapods, cocoapods-core , cocoapods-try.. any other package use by cocoa pods. Use this terminal command to list all the packages : gem list --local | grep cocoa pods

    After that , I also delete ./cocoapods folder from user root folder.

    0 讨论(0)
  • 2020-12-07 08:14

    Open the Terminal -> copy below command

    sudo gem install cocoapods
    

    It will install the latest stable version of cocoapods.

    after that, you need to update pod using below command

    pod setup
    

    You can check pod version using below command

    pod --version
    
    0 讨论(0)
  • 2020-12-07 08:18

    For those with a sudo-less CocoaPods installation (i.e., you do not want to grant RubyGems admin privileges), you don't need the sudo command to update your CocoaPods installation:

    gem install cocoapods
    

    You can find out where the CocoaPods gem is installed with:

    gem which cocoapods
    

    If this is within your home directory, you should definitely run gem install cocoapods without using sudo.

    Finally, to check which CocoaPods you are currently running type:

    pod --version
    
    0 讨论(0)
  • 2020-12-07 08:20
    First check cocoapods version
    like pod --version
    then update like sudo gem install cocoapods --pre
    
    after update you can also check cocoapods version.
    

    enter image description here

    0 讨论(0)
  • 2020-12-07 08:21

    If you got System Integrity Protection enabled or any other permission write error, which is enabled by default since macOS Sierra release, you should update CocoaPods, running this line in terminal:

    sudo gem install cocoapods -n/usr/local/bin
    

    After installing, check your pod version:

    pod --version
    

    You will get rid of this error:

    ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /usr/bin directory
    

    And it will install latest CocoaPods:

    Successfully installed cocoapods-x.x.x
    Parsing documentation for cocoapods-x.x.x
    Installing ri documentation for cocoapods-x.x.x
    Done installing documentation for cocoapods after 4 seconds
    1 gem installed
    
    0 讨论(0)
  • 2020-12-07 08:22

    You can solve this problem by these Commands:

    First:

    sudo gem install cocoapods
    

    Desp: type user mac password now your cocoapods will be replace with a stable version.

    You can find out where the CocoaPods gem is installed with:

    gem which cocoapods
    

    if you have cloned the repo then type this command:

    pod repo update
    

    close your xcode and run this command

    Pod install
    
    0 讨论(0)
提交回复
热议问题