赞
踩
1.用safari打开“https://raw.githubusercontent.com/Homebrew/install/master/install.sh”,把里面的文本复制下来,在桌面创建文本文件“brew_install”,粘贴.
2.搜索:
BREW_REPO="https://github.com/Homebrew/brew"
替换成:
BREW_REPO="https://mirrors.ustc.edu.cn/brew.git"
保存.
3.打开terminal,运行命令:/bin/bash + 刚才的brew_install文件,比如:
/bin/bash /Users/admin/Desktop/brew_install
2.png
4.进入下面的 Taps 目录,clone homebrew-core
- cd /usr/local/Homebrew/Library/Taps/homebrew (如果没有homebrew,新建homebrew文件夹)
-
- git clone https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
5.把homebrew repo切换为清华镜像
- cd "$(brew --repo)"
-
- git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
-
- cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
-
- git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
-
- brew update
PS:如果有报错:curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused,可以通过这个命令解决:sudo gem install redis
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。