1. 什么是brew
homebrew就好像是Linux操作系统下的:apt-get、yum,用来安装管理其他程序。
2 安装: 执行安装命令,见官网(https://brew.sh/index_zh-cn):
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
等了 n 久之后看到如下结果
remote: Counting objects: 100% (4942/4942), done.
remote: Compressing objects: 100% (4742/4742), done.
Receiving objects: 57% (2831/4942), 2.28 MiB | 9.00 KiB/s
remote: Total 4942 (delta 49), reused 337 (delta 8), pack-reused 0
Receiving objects: 100% (4942/4942), 3.98 MiB | 9.00 KiB/s, done.
Resolving deltas: 100% (49/49), done.
Tapped 2 commands and 4726 formulae (4,984 files, 12.3MB).
Already up-to-date.
Warning: /usr/local/bin is not in your PATH.
==> Installation successful!
==> Homebrew has enabled anonymous aggregate formulae and cask analytics.
Read the analytics documentation (and how to opt-out) here:
https://docs.brew.sh/Analytics
==> Homebrew is run entirely by unpaid volunteers. Please consider donating:
https://github.com/Homebrew/brew#donations
==> Next steps:
- Run `brew help` to get started
- Further documentation:
https://docs.brew.sh
192:~ wxh$
192:~ wxh$ brew seach go
-bash: brew: command not found
Warning: /usr/local/bin is not in your PATH.
提示 /usr/local/bin 没有在我的 PATH 环境变量里
终端输入命令 export PATH=/usr/local/bin:$PATH 即可解决这个问题。