Mac下安装Homebrew

来源:互联网 发布:2015中国财政支出数据 编辑:程序博客网 时间:2024/04/28 12:14

Mac下安装Homebrew

说明:在Mac下配置相关开发环境的时候,可能需要用到Homebrew,也就是说,配置好Homebrew是前置条件。例如:在Mac OS下进行PostgreSQL的配置安装,就需要使用到Homebrew进行安装。(该文档2015年的时候整理好了,一直没发,最近电脑重装系统,配置了相关环境,找了很久的文档,现在贴出来,第一给自己日后做参考,第二,给需要的小伙伴们做做参考)

0、准备工作
Home-brew安装地址
http://brew.sh/index_zh-cn.html

3

1、安装步骤(在终端下操作)
1)$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
2)回车键 —> 输入密码(即出现:“Press RETURN to continue or any other key to abort”
以下贴出我终端打印出来的信息

Press RETURN to continue or any other key to abort==> /usr/bin/sudo /bin/chmod g+rwx /usr/local/. /usr/local/binPassword:==> /usr/bin/sudo /usr/sbin/chown wangjiaheng /usr/local/. /usr/local/bin==> /usr/bin/sudo /usr/bin/chgrp admin /usr/local/. /usr/local/bin==> /usr/bin/sudo /bin/mkdir /Library/Caches/Homebrew==> /usr/bin/sudo /bin/chmod g+rwx /Library/Caches/Homebrew==> /usr/bin/sudo /usr/sbin/chown wangjiaheng /Library/Caches/Homebrew==> Downloading and installing Homebrew...remote: Counting objects: 4061, done.remote: Compressing objects: 100% (3911/3911), done.remote: Total 4061 (delta 35), reused 1858 (delta 19), pack-reused 0Receiving objects: 100% (4061/4061), 3.33 MiB | 121.00 KiB/s, done.Resolving deltas: 100% (35/35), done.From https://github.com/Homebrew/homebrew * [new branch]      master     -> origin/masterHEAD is now at 7f8aa6d youtube-dl: update 2016.03.06 bottle.==> Installation successful!==> Next stepsRun `brew help` to get started

(说明:如果提示缺少插件,可以使用指令:$ brew install wget 进行更新Homebrew
3)检验是否需要更新wget
3-1)输入:$ find Cellar
3-2)如果提示:find: Cellar: No such file or directory

ShiXionweideMBP:~ shixiongwei$ find Cellarfind: Cellar: No such file or directoryShiXionweideMBP:~ shixiongwei$ brew install wgetUpdating Homebrew...==> Installing dependencies for wget: openssl==> Installing wget dependency: openssl==> Downloading https://homebrew.bintray.com/bottles/openssl-1.0.2k.sierra.bottl######################################################################## 100.0%==> Pouring openssl-1.0.2k.sierra.bottle.tar.gz==> Using the sandbox==> CaveatsA CA file has been bootstrapped using certificates from the SystemRootskeychain. To add additional certificates (e.g. the certificates added inthe System keychain), place .pem files in  /usr/local/etc/openssl/certsand run  /usr/local/opt/openssl/bin/c_rehashThis formula is keg-only, which means it was not symlinked into /usr/local.Apple has deprecated use of OpenSSL in favor of its own TLS and crypto librariesIf you need to have this software first in your PATH run:  echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.bash_profileFor compilers to find this software you may need to set:    LDFLAGS:  -L/usr/local/opt/openssl/lib    CPPFLAGS: -I/usr/local/opt/openssl/include==> Summary��  /usr/local/Cellar/openssl/1.0.2k: 1,696 files, 12M==> Installing wget ==> Downloading https://homebrew.bintray.com/bottles/wget-1.19.1.sierra.bottle.t######################################################################## 100.0%==> Pouring wget-1.19.1.sierra.bottle.tar.gz��  /usr/local/Cellar/wget/1.19.1: 10 files, 1.6M

那么就是缺少套件,需要更新wget。
3-3)使用以下指令更新。

$ brew install wget

3-4)跟新完之后,使用$ find Cellar,就可以查找到相对应的信息了。

4

0 0
原创粉丝点击