最新版本的thrift是0.13.0版本,但項目要求的版本是0.10.0袋毙,如何安裝特定版本的thrift呢?
首先卸載之前的thrift
brew uninstall thrift
用Git下載homebrew
git clone https://github.com/Homebrew/homebrew-core.git
git clone https://mirrors.ustc.edu.cn/homebrew-core.git
然后查看thrift的更新記錄
git log ./Formula/thrift.rb | less
找到自己想要的版本id
image.png
執(zhí)行git checkout
git checkout 832eb691902f26783c677a65de4c10e9a916b4b0
然后修改一下配置文件
vim ./Formula/thrift.rb
注釋掉第35行:
# depends_on "python@2" => :optional
使用brew安裝thirft
brew install ./Formula/thrift.rb
安裝成功后冗尤,查看安轉的thrift版本
thrift -version
顯示Thrift version 0.10.0即為安裝成功
但注意執(zhí)行brew update操作時可能會自動更新thrift版本听盖,記得要隨時回退版本。