欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

解决Mac安装thrift因bison报错的问题

程序员文章站 2022-04-10 17:57:16
安装thrift时,报错: bison version 2.5 or higher must be installed on the system! 使用brew in...

安装thrift时,报错:

bison version 2.5 or higher must be installed on the system!

使用brew install bison 安装新版的bison

$ brew list bison
/usr/local/cellar/bison/3.0.4/bin/bison
/usr/local/cellar/bison/3.0.4/bin/yacc
/usr/local/cellar/bison/3.0.4/lib/liby.a
/usr/local/cellar/bison/3.0.4/share/aclocal/bison-i18n.m4
/usr/local/cellar/bison/3.0.4/share/bison/ (23 files)
/usr/local/cellar/bison/3.0.4/share/doc/ (14 files)
/usr/local/cellar/bison/3.0.4/share/info/bison.info
/usr/local/cellar/bison/3.0.4/share/man/ (2 files)

已经安装3.0.4版本

但是安装thrift,仍然报错

bison version 2.5 or higher must be installed on the system!

经查是使用了xcode自带的bison,路径

/applications/xcode.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/bin/

解决办法:

首先将bison改名

cd /applications/xcode.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/bin/

sudo mv bison bison111

然后新版本的bison复制到路径下

sudo cp /usr/local/cellar/bison/3.0.4/bin/bison /applications/xcode.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/bin/

再次安装thrift,安装成功。

cd /applications/xcode.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/bin/

sudo rm bison

sudo mv bison111 bison

以上这篇解决mac安装thrift因bison报错的问题就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持。