How to use a specific version of CocoaPods

人盡茶涼 提交于 2019-12-03 04:19:32

问题


Is it possible to somehow specific the version of CocoaPods I'd like to use when upgrading or installing a Podfile? I've encountered several times where Podfiles work correctly with one version of CocoaPods but not with others.

For example, the syntax I'm looking for is like the following:

pod -v 0.34 install

回答1:


Since CocoaPods is installed through RubyGems you can use their mechanisms for doing this. As outlined here you can do this:

pod _0.34.0_ install

You can verify this is working with:

pod _0.34.0_ --version

Also I would highly advise against doing this at all. I would definitely recommend you keep CocoaPods up to date and change your Podfile as needed to adapt to new versions. At anytime your old version could stop working as expected if we bump the minimum version number.




回答2:


the ultimate solution:

  1. run a bash script to completely uninstall your current verison (Optinal)

    for i in $( gem list --local --no-version | grep cocoapods  ); do
        sudo gem uninstall $i;
    done   
    sudo gem uninstall xcodeproj
    
  2. install a specific verison of CocoaPod

    gem install cocoapods -v 0.39.0
    


来源:https://stackoverflow.com/questions/29406298/how-to-use-a-specific-version-of-cocoapods

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