1.homebrew
查看 brew.git 当前源
cd "$(brew --repo)" && git remote -v
1.origin https://github.com/Homebrew/brew.git (fetch)
2.origin https://github.com/Homebrew/brew.git (push)
查看 homebrew-core.git 当前源
cd "$(brew --repo homebrew/core)" && git remote -v
1.origin https://github.com/Homebrew/homebrew-core.git (fetch)
2.origin https://github.com/Homebrew/homebrew-core.git (push)
修改 brew.git 为阿里源
git -C "$(brew --repo)" remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git
修改 homebrew-core.git 为阿里源
git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git
zsh 替换 brew bintray 镜像
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.zshrc
source ~/.zshrc
bash 替换 brew bintray 镜像
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.bash_profile
source ~/.bash_profile
开始更新
brew update
2.rvm
官方网址:https://www.rvm.io/
安装
\curl -sSL https://get.rvm.io | bash -s stable --ruby
这里只列出安装最新版的情况,具体可参照官网安装指南:https://rvm.io/rvm/install
更新
rvm get stable
查看已知的ruby版本(这里最好先更新rvm)
rvm list known
查看已安装的ruby版本
rvm list
移除已安装的ruby版本
rvm remove 1.0.0
安装某个ruby版本
rvm install 1.0.0
设置默认ruby版本
rvm use 1.0.0 --default
查看当前ruby版本
rvm -v