步驟:php
一、確保本身又brew 能夠下載軟件,若是沒有則在命令中輸入git
curl -LsSf http://github.com/mxcl/homebrew/tarball/master | sudo tar xvz -C/usr/local --strip 1
二、進入超級用戶github
sudo su
三、下載安裝thrift,安裝時間比較長api
brew install thrift
安裝過程bash
sh-3.2# brew install thrift ==> Installing dependencies for thrift: boost ==> Installing thrift dependency: boost ==> Downloading https://homebrew.bintray.com/bottles/boost-1.60.0_2.el_capitan.b ######################################################################## 100.0% ==> Pouring boost-1.60.0_2.el_capitan.bottle.1.tar.gz 🍺 /usr/local/Cellar/boost/1.60.0_2: 11,139 files, 434.0M ==> Installing thrift ==> Downloading https://homebrew.bintray.com/bottles/thrift-0.9.3.el_capitan.bot ######################################################################## 100.0% ==> Pouring thrift-0.9.3.el_capitan.bottle.tar.gz ==> Caveats To install Ruby binding: gem install thrift To install PHP extension for e.g. PHP 5.5: brew install homebrew/php/php55-thrift ==> Summary 🍺 /usr/local/Cellar/thrift/0.9.3: 94 files, 5.3M sh-3.2#
四、安裝完後,確認thrift是否安裝完成curl
sh-3.2# thrift -version Thrift version 0.9.3 sh-3.2#
總結:url
從官網直接下載thrift.tar.gz本地安裝,會出錯。若是出錯,最好的解決方式就是brew在線下載安裝。本人將網上的大部分的操做都試過,可是換湯不換藥。根據在線安裝的步驟,須要先下載安裝boost,而後再下載thrift安裝。code