mac环境安装thrift编译器过程中出现了不少报错。
报错一 Bison version 2.5 or higher must be installed on the system
检查已安装的bison程序,已经安装了3.8.2版本
crazyboy@promote thrift-0.15.0 % brew list bison
/usr/local/Cellar/bison/3.8.2/bin/bison
/usr/local/Cellar/bison/3.8.2/bin/yacc
/usr/local/Cellar/bison/3.8.2/lib/liby.a
/usr/local/Cellar/bison/3.8.2/share/aclocal/bison-i18n.m4
/usr/local/Cellar/bison/3.8.2/share/bison/ (29 files)
/usr/local/Cellar/bison/3.8.2/share/doc/ (55 files)
/usr/local/Cellar/bison/3.8.2/share/info/bison.info
/usr/local/Cellar/bison/3.8.2/share/man/ (2 files)
但是bison --version还是2.3
crazyboy@promote thrift-0.15.0 % bison --version
bison (GNU Bison) 2.3
原因是现在使用的是默认的bison版本,找到默认版本的目录/Library/Developer/CommandLineTools/usr/bin/bison
,把这个目录下的bison重命名,再将最版的bison复制进来
cd /Library/Developer/CommandLineTools/usr/bin
sudo mv bison bison-old
sudo cp /usr/local/opt/bison/bin/bison .
检查bison版本
crazyboy@promote bin % bison --version
bison (GNU Bison) 3.8.2
报错二 could not create '/usr/lib/python2.7/site-packages': Operation not permitted
解决方法,安装python3
brew install python3
验证是否安装成功
crazyboy@promote thrift-0.15.0 % python3 -V
Python 3.8.2
报错三 composer: No such file or directory
解决方法,安装composer
brew install composer
验证是否安装成功
crazyboy@promote bin % composer -V
Composer version 2.1.9 2021-10-05 09:47:38
网友评论