因為安裝其他東西動了環(huán)境導(dǎo)致protobuf的命令無法執(zhí)行。報錯command not found: protoc。沒找到原因,想著就直接卸載重裝了protobuf。
$ brew uninstall protobuf
//然后重新安裝
$ brew install protobuf
安裝之后link失敗了,報錯如下
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink lib/libprotobuf.a
Target /usr/local/lib/libprotobuf.a
already exists.
網(wǎng)上找了一圈,執(zhí)行下就可以重新link了。
$ sudo chown -R `whoami` /usr/local
$ brew link --overwrite protobuf
然后protobuf指令也正常了。
$ protoc --version