Sorry: more details. Here are the Terminal commands copied/pasted from my computer:
Last login: Mon Aug 22 07:45:01 on console
Frank-Yang:~ frank$ brew install libav
-bash: brew: command not found
Frank-Yang:~ frank$ 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/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
==> The following directories will be made group writable:
/usr/local/.
/usr/local/bin
/usr/local/include
/usr/local/lib
/usr/local/lib/pkgconfig
==> The following directories will have their owner set to frank:
/usr/local/.
/usr/local/bin
/usr/local/include
/usr/local/lib
/usr/local/lib/pkgconfig
==> The following directories will have their group set to admin:
/usr/local/.
/usr/local/bin
/usr/local/include
/usr/local/lib
/usr/local/lib/pkgconfig
Press RETURN to continue or any other key to abort
Frank-Yang:~ frank$ brew install libav
-bash: brew: command not found
Frank-Yang:~ frank$ /usr/bin/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/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
==> The following directories will be made group writable:
/usr/local/.
/usr/local/bin
/usr/local/include
/usr/local/lib
/usr/local/lib/pkgconfig
==> The following directories will have their owner set to frank:
/usr/local/.
/usr/local/bin
/usr/local/include
/usr/local/lib
/usr/local/lib/pkgconfig
==> The following directories will have their group set to admin:
/usr/local/.
/usr/local/bin
/usr/local/include
/usr/local/lib
/usr/local/lib/pkgconfig
Press RETURN to continue or any other key to abort
==> /usr/bin/sudo /bin/chmod g+rwx /usr/local/. /usr/local/bin /usr/local/include /usr/local/lib /usr/local/lib/pkgconfig
WARNING: Improper use of the sudo command could lead to data loss
or the deletion of important system files. Please double-check your
typing when using sudo. Type "man sudo" for more information.
To proceed, enter your password, or type Ctrl-C to abort.
Password:
Sorry, try again.
Password:
Sorry, try again.
Password:
==> /usr/bin/sudo /usr/sbin/chown frank /usr/local/. /usr/local/bin /usr/local/include /usr/local/lib /usr/local/lib/pkgconfig
==> /usr/bin/sudo /usr/bin/chgrp admin /usr/local/. /usr/local/bin /usr/local/include /usr/local/lib /usr/local/lib/pkgconfig
==> /usr/bin/sudo /bin/mkdir -p /Users/frank/Library/Caches/Homebrew
==> /usr/bin/sudo /bin/chmod g+rwx /Users/frank/Library/Caches/Homebrew
==> /usr/bin/sudo /usr/sbin/chown frank /Users/frank/Library/Caches/Homebrew
==> Searching online for the Command Line Tools
==> /usr/bin/sudo /usr/bin/touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
==> Installing Command Line Tools (OS X 10.11) for Xcode-7.3
==> /usr/bin/sudo /usr/sbin/softwareupdate -i Command\ Line\ Tools\ (OS\ X\ 10.11)\ for\ Xcode-7.3
Software Update Tool
Copyright 2002-2015 Apple Inc.
Downloading Command Line Tools (OS X 10.11) for Xcode
Downloaded Command Line Tools (OS X 10.11) for Xcode
Installing Command Line Tools (OS X 10.11) for Xcode
Done with Command Line Tools (OS X 10.11) for Xcode
Done.
==> /usr/bin/sudo /bin/rm -f /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
==> /usr/bin/sudo /usr/bin/xcode-select --switch /Library/Developer/CommandLineTools
==> Downloading and installing Homebrew...
remote: Counting objects: 1030, done.
remote: Compressing objects: 100% (919/919), done.
remote: Total 1030 (delta 93), reused 690 (delta 70), pack-reused 0
Receiving objects: 100% (1030/1030), 1.03 MiB | 0 bytes/s, done.
Resolving deltas: 100% (93/93), done.
From https://github.com/Homebrew/brew
* [new branch] master -> origin/master
Checking out files: 100% (973/973), done.
HEAD is now at 31052a9 Merge pull request #782 from MikeMcQuaid/weak-imports-opt-in
==> Tapping homebrew/core
Cloning into '/usr/local/Library/Taps/homebrew/homebrew-core'...
remote: Counting objects: 3718, done.
remote: Compressing objects: 100% (3605/3605), done.
remote: Total 3718 (delta 15), reused 1789 (delta 4), pack-reused 0
Receiving objects: 100% (3718/3718), 2.87 MiB | 0 bytes/s, done.
Resolving deltas: 100% (15/15), done.
Checking connectivity... done.
Checking out files: 100% (3722/3722), done.
Tapped 3596 formulae (3,745 files, 8.9M)
==> Installation successful!
==> Next steps
Run `brew help` to get started
Further documentation: https://git.io/brew-docs
==> Homebrew has enabled anonymous aggregate user behaviour analytics
Read the analytics documentation (and how to opt-out) here:
https://git.io/brew-analytics
Frank-Yang:~ frank$ brew install libav
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> Updated Formulae
mozjpeg
==> Installing dependencies for libav: faac, lame, x264, xvid
==> Installing libav dependency: faac
==> Downloading https://homebrew.bintray.com/bottles/faac-1.28.el_capitan.bottle
######################################################################## 100.0%
==> Pouring faac-1.28.el_capitan.bottle.1.tar.gz
/usr/local/Cellar/faac/1.28: 15 files, 671.7K
==> Installing libav dependency: lame
==> Downloading https://homebrew.bintray.com/bottles/lame-3.99.5.el_capitan.bott
######################################################################## 100.0%
==> Pouring lame-3.99.5.el_capitan.bottle.1.tar.gz
/usr/local/Cellar/lame/3.99.5: 26 files, 2M
==> Installing libav dependency: x264
==> Downloading https://homebrew.bintray.com/bottles/x264-r2668.el_capitan.bottl
######################################################################## 100.0%
==> Pouring x264-r2668.el_capitan.bottle.tar.gz
/usr/local/Cellar/x264/r2668: 10 files, 3.3M
==> Installing libav dependency: xvid
==> Downloading https://homebrew.bintray.com/bottles/xvid-1.3.4.el_capitan.bottl
######################################################################## 100.0%
==> Pouring xvid-1.3.4.el_capitan.bottle.tar.gz
/usr/local/Cellar/xvid/1.3.4: 9 files, 1.3M
==> Installing libav
==> Downloading https://homebrew.bintray.com/bottles/libav-11.4_2.el_capitan.bot
######################################################################## 100.0%
==> Pouring libav-11.4_2.el_capitan.bottle.2.tar.gz
/usr/local/Cellar/libav/11.4_2: 8 files, 17.9M
Frank-Yang:~ frank$ brew analytics off
Frank-Yang:~ frank$
[Restored Aug 30, 2016, 9:31:35 AM]