统一项目Cocoapods版本和Gem环境
统一项目Cocoapods版本和Gem环境
通过Gem统一项目Cocoapods版本
检测是否有
rbenv
,直接在命令行中输入rbenv
,看是否会出现版本提示信息apple。如果没有出现,需要通过brew install rbenv
命初始化sdk什么意思令来安装.
如果安装过程中出现如下报错:
==> Pouring ruby-build-20220412.all.bottle.tar.gz Ergiticomfort是什么轮胎ror: No such file or diios14.4.1更新了什么rec初始化电脑时出现问题未进行更改tory @ rb_sysopen – /Users/xxx/Library/Caches/Homebrew/downloads/4ff0b9e0c99846bf0bf4b5be5f73dc12cd2Git7499bdeff6d8b6dede0f2b860f969–ruby-build-20220412.all.bottle.tar.gz
先安装ruby-build
,执行brew install ruby-buios15ild
然后再次执行brew install rbenvios越狱
即可使用
rbenv
管github中文官网网页理Ruby
版本。3.0.0
是最新稳定版本,或者使用rvm install ruby --heappetitead
安装rvm能够支持的最新ruby
版本rbenv install 3.0.0
rbenv shell 3.0.0
1.查看当前rvm版本可以管理的ruby版本列表
rvm list known
,如果rvm版本过低,高版本的ruby是安装不了的2.
rvm list
查看本地安装的ruby版本使ruby环境生效
安装后可以查询系统级Gem依赖
gem list
使用Bundler管理工程中的Ge命令行常用命令m环境
在iOS初始化工程中初始化Bundler环境,在工程主目录中执行
bundle init
命令,这时主目录中会生成一个Gemfile文件.1.如果遇到如下错误:
/ios系统Users/命令行选项语法错误怎么办xxx/.rbenv/versions/3.0.0/lib/ruby/3.0.0/rubygems.rb:281:in
find_spec_for_exe': Could not figithub永久回家地址nd 'bundler' (1.github中文官网网页15.4) req初始化电脑时出现问题未进行更改uired by your /Users/xxx/app/deiOSmo/Gemfile.lock. (Gem::GemNotFoundException) To update to the latest version installed on your system, run
bundle update –bundler. To install the missing version初始化, run
gem install bundler:gitlab1.1iOS5.4giti轮胎from命令行删除文件 /Users/xx命令行怎么打开x/.rbenv/versi初始化电脑的后果ons/3.0.0/lib/ruby/3.0.0/rubygems.rb:300:in
activate_binappointment_path’ from /Usgiti轮胎ers/xxx/.rbenv/versions/3.0.0/bin/bundle:23:in<main&命令行选项语法错误怎么办gt;
可以根据报错提示先执行
gem install bundler:1.15.4
,然后命令行选项语法错误怎么办执行bundle init
2.如果已经存在
Gemfileios系统
文件,仍然执行bundlgiticomfort是什么轮胎e init
,会有如下报错:Gemfile already exists at /Users/xxx/app/demo/Gemfile
编辑Gemfile,执行Pod的版本
# frozen_string_literal: true # A sample Gemfile # source "https://gems.ruby-china.org" source "https://rubygems.org" git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } gem "cocoapods", "1.11.3" gem "fastlane" gem 'xcodeproj' gem 'badge' gem 'dotenv' plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile') eval_gemfile(plugins_path) if File.exist?(plugins_path)
在当前主目录中执行
bundle install
,执行完成之后,指命令行常用命令定版本的CgiteeocoiOSapods就安装成功了。可以通过pod --version
命令查看版本号1.ios越狱执行bundle install时,如果有如下报错:
Could not reach host gems.ruby-china.org. Check your network connection and try again
检初始化失败是怎么解决查source源是不是”gems.ruby-china.org”,改为”rubygems.org”
2.如果有如下冲突报错:
Bundler could not find compatible versi命令行快捷键ons for gem “xcodeproj”: In snapshot (Gemfile.lock): xcodeproj (= 1.8.1)
In Gemfigiteele: xcodeproj
cocoapods (= 1.11.3) was resolved to 1.11.3命令行窗口怎么打开, which deios15pends on xcodeproj (>= 1.21.0, < 2.0)
fastlane was resol命令行窗口ved to 2.98.0, which depends on xcode命令行参数proj (>= 1.5.7, < 2.0.0)
Running
bundle update
will rebuild your snapshot from scratch, using only the gems in your Gemfile,命令行窗口怎么打开 which ma命令行常用命令y resolve the conflgiticomfort是什么轮胎ict.执行
bundle update
,更新Gemfile.lock即可在项目主目录下执行
bundle exec ge初始化英文m list
可以查看到当前Cocoapods的版本执行
bundle exec pod install/update
就可以使用指定版本的Cocoapods进行install或update