[开发环境 -01] 各种开发环境配置
各种开发环境配置
1. HomeBrew 安装在mac上
// 执行官网命令报错:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
// 报错:curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused
// 网上雷同解决办法:https://blog.csdn.net/qq_43531694/article/details/106862753
// 最后我采取的方法是: 替换安装命令
// 将命令设置成不检查证书,执行成功:
/bin/zsh -c "$(curl -k -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
// Test
brew -v
//Homebrew 3.2.6-39-g5ea678b
2. 安装RVM -【用来升级Ruby】
// 执行安装命令:curl -L get.rvm.io | bash -s stable
// 报错: curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused
// 解决:
- 打开网站: https://www.ipaddress.com/
- 查询地址: raw.githubusercontent.com
- 打开hosts编辑:sudo vim /etc/hosts
- 添加ip:raw.githubusercontent.com
// 再次执行上述安装命令即可安装完毕.
// Test
- 关闭终端
- rvm -v
// rvm 1.29.12 (latest) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io]
3. 安装ruby
安装命令: rvm install 2.7
// Test
ruby -v
// ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-darwin20]
4. 安装Cocoapod
# 安装
- 1: 查看gem版本号:gem -v
- 2: 升级rubyGems版本?:sudo gem update --system
- 3: 查看当前gem源?:gem sources -l
- 4: 更改当前gem源?:gem sources --add https://gems.ruby-china.com/ --remove https://rubygems.org/
- 5: 再次查看当前gem源?如果为[https://gems.ruby-china.com/](https://gems.ruby-china.com/)就更换成功。
- 6: 安装命令:
sudo gem install cocoapods
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /usr/bin directory.
改成 sudo gem install -n /usr/local/bin cocoapods 试试
# Test
pod --version
# 1.10.2

浙公网安备 33010602011771号