最近刚把开发平台从windows迁移到Mac,发现有些东西也是需要根据自己需要安装的,所以搜了下,发现网上各路大神推荐brew,看完介绍,感觉不错,搞起安装(这里说下心得,在Mac app store中有很多常用的软件都找不到,例如大名鼎鼎的eclipse,sublime text等,其实是个人想的太狭隘了,以为在Mac上的安装的软件都是要从app store中下载,其实不然,有网友这样说:在Mac app store中发布软件不是不要钱的,开发者需要花一年几百块去开发软件的,当然,你可以光是开发,只是不能在app store中发布,所以有些人不想发布在app store上,花钱用处不大,还不如直接发布在网上不是更好吗)。
1、Homebrew 是 OS X 的包管理工具,Ruby 社区的作品,功能类似 Ubuntu 下的apt-get。
2、在百度搜索时会返回很多在Mac terminal中安装的脚本,虽然看似都很相像,但基本上在安装时都会出现错误,可能是在网友在回答后,homebrew官方更新了安装脚本,所以在安装brew时推荐从官方copy安装脚本,官方网站如下:http://brew.sh/index_zh-cn.html。
3、拷贝到Mac terminal后,回车安装(重要节点高亮显示):
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
==>This script will install:
/usr/local/bin/brew
/usr/local/Library/...
/usr/local/share/man/man1/brew.1
Press RETURN to continue or any other key to abort
==>Downloading and installing Homebrew...
remote: Counting objects: 3693, done.
remote: Compressing objects: 100% (3525/3525), done.
remote: Total 3693 (delta 38), reused 527 (delta 27), pack-reused 0
Receiving objects: 100% (3693/3693), 3.04 MiB | 79.00 KiB/s, done.
Resolving deltas: 100% (38/38), done.
From https://github.com/Homebrew/homebrew
* [new branch] master -> origin/master
HEAD is now at 9c41fb8 update man page
==>Installation successful!
==> Next steps
Run `brew help` to get started
4、到目前为止已成功安装homebrew,在terminal中验证一下,输入:brew help
Example usage:
brew [info | home | options ] [FORMULA...]
brew install FORMULA...
brew uninstall FORMULA...
brew search [foo]
brew list [FORMULA...]
brew update
brew upgrade [FORMULA...]
brew pin/unpin [FORMULA...]
Troubleshooting:
brew doctor
brew install -vd FORMULA
brew [--env | config]
Brewing:
brew create [URL [--no-fetch]]
brew edit [FORMULA...]
https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Formula-Cookbook.md
Further help:
man brew
brew home
成功安装,收工~