Updating to latest version of CocoaPods?

前端 未结 12 1880
误落风尘
误落风尘 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:00

    Execute the following on your terminal to get the latest stable version:

    sudo gem install cocoapods
    

    Add --pre to get the latest pre release:

    sudo gem install cocoapods --pre
    

    If you originally installed the cocoapods gem using sudo, you should use that command again.

    Later on, when you're actively using CocoaPods by installing pods, you will be notified when new versions become available with a CocoaPods X.X.X is now available, please update message.

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

    Below are steps to update cocoapods :

    1. Open terminal (Shortcut : Press cmd + space tab to open Spotlight then text in terminal)
    2. Use command sudo gem install cocoapods. This will ask for system password due to security concern thereafter it installs gems

    1. Now, set up pod using pod setup command. This will setup cocoapods master repo.

    1. You can check the version of cocoapods using pod --version command.

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

    If you are using Homebrew, open terminal and type:

    brew upgrade cocoapods
    

    If that does not work, try:

    brew install cocoapods
    
    0 讨论(0)
  • 2020-12-07 08:05

    This is a really quick & detailed solution

    Open the Terminal and execute the following to get the latest stable version:

    sudo gem install cocoapods
    

    Add --pre to get the latest pre release:

    sudo gem install cocoapods --pre
    

    Incase any error occured

    Try uninstall and install again:

    sudo gem uninstall cocoapods
    sudo gem install cocoapods
    

    Run after updating CocoaPods

    sudo gem clean cocoapods
    

    After updating CocoaPods, also need to update Podfile.lock file in your project.

    Go to your project directory

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

    I change the line "pod 'Alamofire', '~> 4.0'" to "pod 'Alamofire', :git => 'https://github.com/Alamofire/Alamofire', :commit => '3cc5b4e'" after that in terminal: "pod install --repo-update" and it works.

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

    Non of the above solved my problem, you can check pod version using two commands

    1. pod --version
    2. gem which cocoapods

    In my case pod --version always showed "1.5.0" while gem which cocopods shows Library/Ruby/Gems/2.3.0/gems/cocoapods-1.9.0/lib/cocoapods.rb. I tried every thing but unable to update version showed from pod --version. sudo gem install cocopods result in installing latest version but pod --version always showing previous version. Finally I tried these commands

    1. sudo gem update
    2. sudo gem uninstall cocoapods
    3. sudo gem install cocopods
    4. pod setup``pod install

    catch for me was sudo gem update. Hopefully it will help any body else.

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