Homebrew官网:http://brew.shgit
Homebrew installs the stuff you need that Apple didn'tgithub
Homebrew的安装很是简单,打开终端复制、粘贴如下命令。mongodb
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
2.若是你当前的环境变量尚未加入 mongod ,手动添加的环境变量中.shell
$ nano ~/.bash_profileruby
//添加mongodb安装目录到环境变量中bash
export PATH=/usr/local/Cellar/mongodb/3.4.0/bin/:$PATHcurl
3.若是让环境变量立刻生效? 执行下面的url
shell source ~/.bash_profilecode