rvm 是用來(lái)管理 ruby 的,ruby 的其中一個(gè)“程序”叫 rubygems ,簡(jiǎn)稱(chēng) gem,而用來(lái)管理項(xiàng)目的 gem 的,叫 bundle ,他倆完全是不同的東西,相同的只是都可以管理gem。bundler 用來(lái)管理 fastlane 自身版本和 fastlane 運(yùn)行時(shí)的相關(guān)依賴(lài)版本, 相當(dāng)于 iOS 開(kāi)發(fā)中的 CocoaPods 框架, 使用方法也和 CocoaPods 如出一轍
fastlane 會(huì)使用 Gemfile 里面指定的版本使用程序
例子:
gem 'cocoapods' , '~> 1.2.0'
bundle install 安裝當(dāng)前項(xiàng)目的 gem 庫(kù)
由上面的原理可以得出:
如果在公司里面統(tǒng)一使用 Cocoaspod的 版本,可以參考下面的方法
安裝:
gem install bundler
創(chuàng)建 gemfile 文件
cd 項(xiàng)目目錄
bundle init
這樣, 與 .xcodeproj 同級(jí)的目錄中就會(huì)多出一個(gè) Gemfile 文件。
在 Gemfile 里添加如下代碼,指定 pod 版本
# frozen_string_literal: true
source "https://rubygems.org"
# gem "rails"
gem 'cocoapods', '0.39.0'
到這里已經(jīng)安裝完畢,使用起來(lái)也很簡(jiǎn)單
在之前執(zhí)行的命令前面加上 bundle exec 就好了,如:
bundle exec pod install --verbose --no-repo-update
或者
bundle exec pod update --verbose --no-repo-update
cocoapods-downloader