此文档仅作为个人记录使用,步骤非从0到1,具体操作过程有不详细之处,需要科学访问网络,能在终端中执行代理,本文没有替ruby,cocoapods源的操作,一切皆使用默认源。
1.安装oh-m-zsh
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"\
2.安装Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
3.在 .zshrc里面配置环境变量
Path to your homebrew installation.
export PATH="/opt/homebrew/bin:PATH"
4.使配置文件生效
source ~/.zshrc
5.安装gnupg
brew install gnupg
gpg --keyserver hkp://pgp.mit.edu --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB\
6.安装gpg2
brew install gpg2
gpg2 --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
7.安装openssl
brew install openssl
8.安装RVM,在.zshrc配置变量
curl -L get.rvm.io | bash -s stable
Path to your RVM installation.
export PATH=/Users/liuyan/.rvm/scripts/rvm:$PATH
rvm get master
rvm pkg install openssl
9.安装重点,通过openssl@3安装ruby各版本
rvm install 3.2.2 --with-openssl-dir=/opt/homebrew/Cellar/openssl@3
10.成功后切换默认ruby版本,rvm的命令,rvm list known,rvm list。
rvm use ruby-3.2.2 --default
11.重头戏来了,安装cocoapods,两种方式区别暂未了解
brew install cocoapods
或
gem update --system 3.4.17
sudo gem uninstall cocoapods
sudo gem install -n /usr/local/bin cocoapods
5.查看用到的,brew doctor,brew - v,rvm -v,ruby -v,pod --version,gem source -l,source .zshrc(每次vim后使用),which ruby(如果显示的是usr/bin/ruby为系统自带,后面要通过RVM切换到自己的ruby下面)