安装homebrew

安装homebrew:

转自 http://blog.jjgod.org/2009/12/21/homebrew-package-management/

主要指令为:

获得/usr/local权限:

sudo chown -R `user_name` /usr/local

然后用 git 安装:

cd /usr/local
git init
git remote add origin git://github.com/mxcl/homebrew.git
git pull origin master

等待安装完毕后,就可以试试:

brew search

可以搜索出所有可以通过 homebrew 安装的软件,不带任何参数的时候就是列出所有的。可以看到数量已经不少了。

 搜索特定目标
$ brew search
mongodb
mongodb 
安装 $ brew install
mongodb

列出已装
$ brew list
 

更新

如果用了一段时间,需要更新同步上游的 Formula,可以简单地:

$ brew update
$ brew upgrade mongodb
 
以及设置开机启动的命令:
http://ruby-china.org/topics/160

在命令brew install mongodb之后,
If this is your first install, automatically load on login with (这段就是用来设置 MongoDB for Mac 的服务的,会开机自启动):
    mkdir -p ~/Library/LaunchAgents
    cp /usr/local/Cellar/mongodb/2.0.0-x86_64/org.mongodb.mongod.plist ~/Library/LaunchAgents/
    launchctl load -w ~/Library/LaunchAgents/org.mongodb.mongod.plist

If this is an upgrade and you already have the org.mongodb.mongod.plist loaded:
    launchctl unload -w ~/Library/LaunchAgents/org.mongodb.mongod.plist
    cp /usr/local/Cellar/mongodb/2.0.0-x86_64/org.mongodb.mongod.plist ~/Library/LaunchAgents/
    launchctl load -w ~/Library/LaunchAgents/org.mongodb.mongod.plist



 
 
原文地址:https://www.cnblogs.com/edgarli/p/2936532.html