MacOS关于homebrew、rvm和ruby

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

以上内容只作为学习笔记
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。