在macosx上安装rust

570 阅读1分钟

安装rust

curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh

设置环境

source $HOME/.cargo/env

如果brew出现错误,则按照提示输入。

Error: homebrew-core is a shallow clone. To `brew update` first run:
  git -C "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core" fetch --unshallow

如果又出现这个错误

fatal: dumb http transport does not support shallow capabilities

则删掉homebrew-core重新clone一个

cd /usr/local/Homebrew/Library/Taps/homebrew/
rm -rf homebrew-core
git clone https://github.com/Homebrew/homebrew-core.git

之后,homebrew就正常了。