低于1.0版本 pod使用

来源:互联网 发布:python运维 编辑:程序博客网 时间:2024/04/29 11:10

In March, CocoaPods hit an unfortunate problem with our Specs Repo being rate limited.

We announced that we were planning on Sharding the Specs Repo, but were hesitant to do it instantly. Now over six months later we are planning on running the scripts.

  • If you are using CocoaPods 1.x - you should not see any changes.
  • If you are using CocoaPods 0.39 and below, you will see an error saying that your version of CocoaPods is not supported. Previous to this, our minimum version was 0.32.

For people who want to continue using 0.x versions, we will be replicating the Specs repo from the commit before the repo was sharded. This means you can add:

source "https://github.com/CocoaPods/Old-Specs"

To the top of your Podfile, and CocoaPods will only use the archived repo, instead of using the new repo structure. You will also need to set your local Specs repo to a version before the transition:

cd ~/.cocoapods/repos/master/git fetch origin mastergit checkout v0.32.1

To run pod install, you will also need to use --no-repo-update.

We do not have the resources to maintain multiple versions of CocoaPods in our spare time, and so we recommend that instead of doing the above, you migrate to the latest versions of CocoaPods in your projects.


We are planning to do it on Friday November the 11th, so there will be scheduled downtime on pushing new Pods to Trunk during the process of updating and verifying that it was successful.

使用Bundle管理Cocoapods版本

MAY 22ND, 2013 | COMMENTS

Cocoapods将Rails的Gem思想成功的迁移到了OSX中,让iOS和MacOS也能快速的管理第三方依赖。

然而,用久了发现一个很尴尬的问题——Cocoapods还不是很完善,因此更新频率很大,虽然我经常更新,但是他对旧版本的Cocoapods兼容性并不好。

例如,我有一个项目是用0.16版本的Cocoapods开发的,过了一段时间,需要对这个项目进行更新,在运行pod install时会出现各种问题,原因是我用新版本的pod来安装旧版本的podfile.lock,虽然官方也尽量在兼容旧版本,但不可避免还是会出现各种问题,例如——用法过期并移除……

这时候想到,进行Rails开发中,用Bundle进行Gem管理,而Cocoapods本身就是一个Gem,那能不能用Bundle来管理Cocoapods呢?

我们先试着在项目根目录下,创建Gemfile文件:

Gemfile
1
gem 'cocoapods', '~> 0.16.0'

执行bundle install:

1234567891011121314151617181920212223
$ bundle installFetching source index from http://ruby.taobao.org/Resolving dependencies...Using rake (10.0.4)Using i18n (0.6.1)Using multi_json (1.7.3)Using activesupport (3.2.13)Using addressable (2.3.4)Using colored (1.2)Using escape (0.0.4)Using multipart-post (1.2.0)Using faraday (0.8.7)Using json (1.7.7)Using faraday_middleware (0.9.0)Using hashie (2.0.5)Using netrc (0.7.7)Using octokit (1.24.0)Using open4 (1.3.0)Using xcodeproj (0.5.5)Installing cocoapods (0.16.4)Using bundler (1.3.5)Your bundle is complete!Use `bundle show [gemname]` to see where a bundled gem is installed.

gem list看看本地有哪几个版本cocoapods:

12345
$ gem list cocoapods*** LOCAL GEMS ***cocoapods (0.19.1, 0.16.4)

现在试试能否用旧版本的cocoapods:

12
$ pod --version0.16.4

退出项目文件夹,去其他文件夹试试会不会自动切换到新版本:

123
$ cd ..$ pod --version0.19.1

成功!

发现有人直接用pod --version没效果,可能是他不是使用最新版本的RVM,则需要手动调用bundle:

12
$ bundle exec pod --version0.16.1

 May 22nd, 2013  ruby


原创粉丝点击