brew error

# net work error
```
$ brew update
fatal: unable to access 'https://github.com/Homebrew/brew/': Could not resolve host: github.com
fatal: unable to access 'https://github.com/Homebrew/homebrew-core/': Could not resolve host: github.com
fatal: unable to access 'https://github.com/Homebrew/homebrew-cask/': Could not resolve host: github.com
Error: Fetching /usr/local/Homebrew failed!
Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core failed!
Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask failed!
```

# user

```
$ brew update
Error: Can't create update lock in /usr/local/var/homebrew/locks!
Fix permissions by running:
  sudo chown -R $(whoami) /usr/local/var/homebrew
$ sudo chown -R $(whoami) /usr/local/var/homebrew
Password:
```

```
$ brew update
touch: /usr/local/Homebrew/.git/FETCH_HEAD: Permission denied
error: cannot open .git/FETCH_HEAD: Permission denied
/usr/local/Homebrew/Library/Homebrew/cmd/update.sh: line 541: /usr/local/Homebrew/.git/UPDATE_FAILED: Permission denied
touch: /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask/.git/FETCH_HEAD: Permission denied
touch: /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/.git/FETCH_HEAD: Permission denied
error: cannot open .git/FETCH_HEAD: Permission denied
/usr/local/Homebrew/Library/Homebrew/cmd/update.sh: line 541: /usr/local/Homebrew/.git/UPDATE_FAILED: Permission denied
error: cannot open .git/FETCH_HEAD: Permission denied
/usr/local/Homebrew/Library/Homebrew/cmd/update.sh: line 541: /usr/local/Homebrew/.git/UPDATE_FAILED: Permission denied
fatal: Unable to create '/usr/local/Homebrew/.git/index.lock': Permission denied
error: could not lock config file .git/config: Permission denied
Already up-to-date.

$ sudo chown -R brew_manager /usr/local/Homebrew/

$ brew update

$ $ brew upgrade
Error: The following directories are not writable by your user:
/usr/local/etc/bash_completion.d
/usr/local/lib/pkgconfig
/usr/local/share/aclocal
/usr/local/share/doc
/usr/local/share/info
/usr/local/share/locale
/usr/local/share/man
/usr/local/share/man/man1
/usr/local/share/man/man3
/usr/local/share/man/man5
/usr/local/share/man/man7
/usr/local/share/zsh
/usr/local/share/zsh/site-functions
/usr/local/var/log

You should change the ownership of these directories to your user.
  sudo chown -R $(whoami) /usr/local/etc/bash_completion.d /usr/local/lib/pkgconfig /usr/local/share/aclocal /usr/local/share/doc /usr/local/share/info /usr/local/share/locale /usr/local/share/man /usr/local/share/man/man1 /usr/local/share/man/man3 /usr/local/share/man/man5 /usr/local/share/man/man7 /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var/log

And make sure that your user has write permission.
  chmod u+w /usr/local/etc/bash_completion.d /usr/local/lib/pkgconfig /usr/local/share/aclocal /usr/local/share/doc /usr/local/share/info /usr/local/share/locale /usr/local/share/man /usr/local/share/man/man1 /usr/local/share/man/man3 /usr/local/share/man/man5 /usr/local/share/man/man7 /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var/log


```

```
$ brew upgrade

...

cp: /usr/local/Cellar/apr/./1.7.0/libexec/include/apr-1/apr_version.h: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/include/apr-1/apr_want.h: No such file or directory
cp: utimes: /usr/local/Cellar/apr/./1.7.0/libexec/include/apr-1: No such file or directory
cp: chown: /usr/local/Cellar/apr/./1.7.0/libexec/include/apr-1: No such file or directory
cp: chmod: /usr/local/Cellar/apr/./1.7.0/libexec/include/apr-1: No such file or directory
cp: chflags: /usr/local/Cellar/apr/./1.7.0/libexec/include/apr-1: No such file or directory
cp: /var/folders/td/nfhj3f6s1tz099djvy3zlj9c0000gs/T/d20190423-40232-1dvoznq/apr/./1.7.0/libexec/include/apr-1: unable to copy ACL to /usr/local/Cellar/apr/./1.7.0/libexec/include/apr-1: No such file or directory
cp: utimes: /usr/local/Cellar/apr/./1.7.0/libexec/include: No such file or directory
cp: chown: /usr/local/Cellar/apr/./1.7.0/libexec/include: No such file or directory
cp: chmod: /usr/local/Cellar/apr/./1.7.0/libexec/include: No such file or directory
cp: chflags: /usr/local/Cellar/apr/./1.7.0/libexec/include: No such file or directory
cp: /var/folders/td/nfhj3f6s1tz099djvy3zlj9c0000gs/T/d20190423-40232-1dvoznq/apr/./1.7.0/libexec/include: unable to copy ACL to /usr/local/Cellar/apr/./1.7.0/libexec/include: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/lib: No such file or directory
cp: /var/folders/td/nfhj3f6s1tz099djvy3zlj9c0000gs/T/d20190423-40232-1dvoznq/apr/./1.7.0/libexec/lib: unable to copy extended attributes to /usr/local/Cellar/apr/./1.7.0/libexec/lib: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/lib/apr.exp: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/lib/libapr-1.0.dylib: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/lib/libapr-1.a: No such file or directory
cp: symlink: libapr-1.0.dylib: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/lib/pkgconfig: No such file or directory
cp: /var/folders/td/nfhj3f6s1tz099djvy3zlj9c0000gs/T/d20190423-40232-1dvoznq/apr/./1.7.0/libexec/lib/pkgconfig: unable to copy extended attributes to /usr/local/Cellar/apr/./1.7.0/libexec/lib/pkgconfig: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/lib/pkgconfig/apr-1.pc: No such file or directory
cp: utimes: /usr/local/Cellar/apr/./1.7.0/libexec/lib/pkgconfig: No such file or directory
cp: chown: /usr/local/Cellar/apr/./1.7.0/libexec/lib/pkgconfig: No such file or directory
cp: chmod: /usr/local/Cellar/apr/./1.7.0/libexec/lib/pkgconfig: No such file or directory
cp: chflags: /usr/local/Cellar/apr/./1.7.0/libexec/lib/pkgconfig: No such file or directory
cp: /var/folders/td/nfhj3f6s1tz099djvy3zlj9c0000gs/T/d20190423-40232-1dvoznq/apr/./1.7.0/libexec/lib/pkgconfig: unable to copy ACL to /usr/local/Cellar/apr/./1.7.0/libexec/lib/pkgconfig: No such file or directory
cp: utimes: /usr/local/Cellar/apr/./1.7.0/libexec/lib: No such file or directory
cp: chown: /usr/local/Cellar/apr/./1.7.0/libexec/lib: No such file or directory
cp: chmod: /usr/local/Cellar/apr/./1.7.0/libexec/lib: No such file or directory
cp: chflags: /usr/local/Cellar/apr/./1.7.0/libexec/lib: No such file or directory
cp: /var/folders/td/nfhj3f6s1tz099djvy3zlj9c0000gs/T/d20190423-40232-1dvoznq/apr/./1.7.0/libexec/lib: unable to copy ACL to /usr/local/Cellar/apr/./1.7.0/libexec/lib: No such file or directory
cp: utimes: /usr/local/Cellar/apr/./1.7.0/libexec: No such file or directory
cp: chown: /usr/local/Cellar/apr/./1.7.0/libexec: No such file or directory
cp: chmod: /usr/local/Cellar/apr/./1.7.0/libexec: No such file or directory
cp: chflags: /usr/local/Cellar/apr/./1.7.0/libexec: No such file or directory
cp: /var/folders/td/nfhj3f6s1tz099djvy3zlj9c0000gs/T/d20190423-40232-1dvoznq/apr/./1.7.0/libexec: unable to copy ACL to /usr/local/Cellar/apr/./1.7.0/libexec: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/LICENSE: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/NOTICE: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/README: No such file or directory
cp: utimes: /usr/local/Cellar/apr/./1.7.0: No such file or directory
cp: chown: /usr/local/Cellar/apr/./1.7.0: No such file or directory
cp: chmod: /usr/local/Cellar/apr/./1.7.0: No such file or directory
cp: chflags: /usr/local/Cellar/apr/./1.7.0: No such file or directory
cp: /var/folders/td/nfhj3f6s1tz099djvy3zlj9c0000gs/T/d20190423-40232-1dvoznq/apr/./1.7.0: unable to copy ACL to /usr/local/Cellar/apr/./1.7.0: Permission denied
cp: utimes: /usr/local/Cellar/apr/.: Operation not permitted
Error: Failure while executing; `cp -pR /var/folders/td/nfhj3f6s1tz099djvy3zlj9c0000gs/T/d20190423-40232-1dvoznq/apr/. /usr/local/Cellar/apr` exited with 1. Here's the output:
cp: /usr/local/Cellar/apr/./1.7.0: Permission denied
cp: /var/folders/td/nfhj3f6s1tz099djvy3zlj9c0000gs/T/d20190423-40232-1dvoznq/apr/./1.7.0: unable to copy extended attributes to /usr/local/Cellar/apr/./1.7.0: Permission denied
cp: /usr/local/Cellar/apr/./1.7.0/.brew: No such file or directory
cp: /var/folders/td/nfhj3f6s1tz099djvy3zlj9c0000gs/T/d20190423-40232-1dvoznq/apr/./1.7.0/.brew: unable to copy extended attributes to /usr/local/Cellar/apr/./1.7.0/.brew: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/.brew/apr.rb: No such file or directory
cp: utimes: /usr/local/Cellar/apr/./1.7.0/.brew: No such file or directory
cp: chown: /usr/local/Cellar/apr/./1.7.0/.brew: No such file or directory
cp: chmod: /usr/local/Cellar/apr/./1.7.0/.brew: No such file or directory
cp: chflags: /usr/local/Cellar/apr/./1.7.0/.brew: No such file or directory
cp: /var/folders/td/nfhj3f6s1tz099djvy3zlj9c0000gs/T/d20190423-40232-1dvoznq/apr/./1.7.0/.brew: unable to copy ACL to /usr/local/Cellar/apr/./1.7.0/.brew: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/bin: No such file or directory
cp: /var/folders/td/nfhj3f6s1tz099djvy3zlj9c0000gs/T/d20190423-40232-1dvoznq/apr/./1.7.0/bin: unable to copy extended attributes to /usr/local/Cellar/apr/./1.7.0/bin: No such file or directory
cp: symlink: ../libexec/bin/apr-1-config: No such file or directory
cp: utimes: /usr/local/Cellar/apr/./1.7.0/bin: No such file or directory
cp: chown: /usr/local/Cellar/apr/./1.7.0/bin: No such file or directory
cp: chmod: /usr/local/Cellar/apr/./1.7.0/bin: No such file or directory
cp: chflags: /usr/local/Cellar/apr/./1.7.0/bin: No such file or directory
cp: /var/folders/td/nfhj3f6s1tz099djvy3zlj9c0000gs/T/d20190423-40232-1dvoznq/apr/./1.7.0/bin: unable to copy ACL to /usr/local/Cellar/apr/./1.7.0/bin: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/CHANGES: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/INSTALL_RECEIPT.json: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec: No such file or directory
cp: /var/folders/td/nfhj3f6s1tz099djvy3zlj9c0000gs/T/d20190423-40232-1dvoznq/apr/./1.7.0/libexec: unable to copy extended attributes to /usr/local/Cellar/apr/./1.7.0/libexec: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/bin: No such file or directory
cp: /var/folders/td/nfhj3f6s1tz099djvy3zlj9c0000gs/T/d20190423-40232-1dvoznq/apr/./1.7.0/libexec/bin: unable to copy extended attributes to /usr/local/Cellar/apr/./1.7.0/libexec/bin: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/bin/apr-1-config: No such file or directory
cp: utimes: /usr/local/Cellar/apr/./1.7.0/libexec/bin: No such file or directory
cp: chown: /usr/local/Cellar/apr/./1.7.0/libexec/bin: No such file or directory
cp: chmod: /usr/local/Cellar/apr/./1.7.0/libexec/bin: No such file or directory
cp: chflags: /usr/local/Cellar/apr/./1.7.0/libexec/bin: No such file or directory
cp: /var/folders/td/nfhj3f6s1tz099djvy3zlj9c0000gs/T/d20190423-40232-1dvoznq/apr/./1.7.0/libexec/bin: unable to copy ACL to /usr/local/Cellar/apr/./1.7.0/libexec/bin: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/build-1: No such file or directory
cp: /var/folders/td/nfhj3f6s1tz099djvy3zlj9c0000gs/T/d20190423-40232-1dvoznq/apr/./1.7.0/libexec/build-1: unable to copy extended attributes to /usr/local/Cellar/apr/./1.7.0/libexec/build-1: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/build-1/apr_rules.mk: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/build-1/libtool: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/build-1/make_exports.awk: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/build-1/make_var_export.awk: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/build-1/mkdir.sh: No such file or directory
cp: utimes: /usr/local/Cellar/apr/./1.7.0/libexec/build-1: No such file or directory
cp: chown: /usr/local/Cellar/apr/./1.7.0/libexec/build-1: No such file or directory
cp: chmod: /usr/local/Cellar/apr/./1.7.0/libexec/build-1: No such file or directory
cp: chflags: /usr/local/Cellar/apr/./1.7.0/libexec/build-1: No such file or directory
cp: /var/folders/td/nfhj3f6s1tz099djvy3zlj9c0000gs/T/d20190423-40232-1dvoznq/apr/./1.7.0/libexec/build-1: unable to copy ACL to /usr/local/Cellar/apr/./1.7.0/libexec/build-1: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/include: No such file or directory
cp: /var/folders/td/nfhj3f6s1tz099djvy3zlj9c0000gs/T/d20190423-40232-1dvoznq/apr/./1.7.0/libexec/include: unable to copy extended attributes to /usr/local/Cellar/apr/./1.7.0/libexec/include: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/include/apr-1: No such file or directory
cp: /var/folders/td/nfhj3f6s1tz099djvy3zlj9c0000gs/T/d20190423-40232-1dvoznq/apr/./1.7.0/libexec/include/apr-1: unable to copy extended attributes to /usr/local/Cellar/apr/./1.7.0/libexec/include/apr-1: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/include/apr-1/apr.h: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/include/apr-1/apr_allocator.h: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/include/apr-1/apr_atomic.h: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/include/apr-1/apr_cstr.h: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/include/apr-1/apr_dso.h: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/include/apr-1/apr_encode.h: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/include/apr-1/apr_env.h: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/include/apr-1/apr_errno.h: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/include/apr-1/apr_escape.h: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/include/apr-1/apr_file_info.h: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/include/apr-1/apr_file_io.h: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/include/apr-1/apr_fnmatch.h: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/include/apr-1/apr_general.h: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/include/apr-1/apr_getopt.h: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/include/apr-1/apr_global_mutex.h: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/include/apr-1/apr_hash.h: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/include/apr-1/apr_inherit.h: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/include/apr-1/apr_lib.h: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/include/apr-1/apr_mmap.h: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/include/apr-1/apr_network_io.h: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/include/apr-1/apr_perms_set.h: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/include/apr-1/apr_poll.h: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/include/apr-1/apr_pools.h: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/include/apr-1/apr_portable.h: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/include/apr-1/apr_proc_mutex.h: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/include/apr-1/apr_random.h: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/include/apr-1/apr_ring.h: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/include/apr-1/apr_shm.h: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/include/apr-1/apr_signal.h: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/include/apr-1/apr_skiplist.h: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/include/apr-1/apr_strings.h: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/include/apr-1/apr_support.h: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/include/apr-1/apr_tables.h: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/include/apr-1/apr_thread_cond.h: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/include/apr-1/apr_thread_mutex.h: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/include/apr-1/apr_thread_proc.h: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/include/apr-1/apr_thread_rwlock.h: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/include/apr-1/apr_time.h: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/include/apr-1/apr_user.h: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/include/apr-1/apr_version.h: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/include/apr-1/apr_want.h: No such file or directory
cp: utimes: /usr/local/Cellar/apr/./1.7.0/libexec/include/apr-1: No such file or directory
cp: chown: /usr/local/Cellar/apr/./1.7.0/libexec/include/apr-1: No such file or directory
cp: chmod: /usr/local/Cellar/apr/./1.7.0/libexec/include/apr-1: No such file or directory
cp: chflags: /usr/local/Cellar/apr/./1.7.0/libexec/include/apr-1: No such file or directory
cp: /var/folders/td/nfhj3f6s1tz099djvy3zlj9c0000gs/T/d20190423-40232-1dvoznq/apr/./1.7.0/libexec/include/apr-1: unable to copy ACL to /usr/local/Cellar/apr/./1.7.0/libexec/include/apr-1: No such file or directory
cp: utimes: /usr/local/Cellar/apr/./1.7.0/libexec/include: No such file or directory
cp: chown: /usr/local/Cellar/apr/./1.7.0/libexec/include: No such file or directory
cp: chmod: /usr/local/Cellar/apr/./1.7.0/libexec/include: No such file or directory
cp: chflags: /usr/local/Cellar/apr/./1.7.0/libexec/include: No such file or directory
cp: /var/folders/td/nfhj3f6s1tz099djvy3zlj9c0000gs/T/d20190423-40232-1dvoznq/apr/./1.7.0/libexec/include: unable to copy ACL to /usr/local/Cellar/apr/./1.7.0/libexec/include: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/lib: No such file or directory
cp: /var/folders/td/nfhj3f6s1tz099djvy3zlj9c0000gs/T/d20190423-40232-1dvoznq/apr/./1.7.0/libexec/lib: unable to copy extended attributes to /usr/local/Cellar/apr/./1.7.0/libexec/lib: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/lib/apr.exp: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/lib/libapr-1.0.dylib: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/lib/libapr-1.a: No such file or directory
cp: symlink: libapr-1.0.dylib: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/lib/pkgconfig: No such file or directory
cp: /var/folders/td/nfhj3f6s1tz099djvy3zlj9c0000gs/T/d20190423-40232-1dvoznq/apr/./1.7.0/libexec/lib/pkgconfig: unable to copy extended attributes to /usr/local/Cellar/apr/./1.7.0/libexec/lib/pkgconfig: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/libexec/lib/pkgconfig/apr-1.pc: No such file or directory
cp: utimes: /usr/local/Cellar/apr/./1.7.0/libexec/lib/pkgconfig: No such file or directory
cp: chown: /usr/local/Cellar/apr/./1.7.0/libexec/lib/pkgconfig: No such file or directory
cp: chmod: /usr/local/Cellar/apr/./1.7.0/libexec/lib/pkgconfig: No such file or directory
cp: chflags: /usr/local/Cellar/apr/./1.7.0/libexec/lib/pkgconfig: No such file or directory
cp: /var/folders/td/nfhj3f6s1tz099djvy3zlj9c0000gs/T/d20190423-40232-1dvoznq/apr/./1.7.0/libexec/lib/pkgconfig: unable to copy ACL to /usr/local/Cellar/apr/./1.7.0/libexec/lib/pkgconfig: No such file or directory
cp: utimes: /usr/local/Cellar/apr/./1.7.0/libexec/lib: No such file or directory
cp: chown: /usr/local/Cellar/apr/./1.7.0/libexec/lib: No such file or directory
cp: chmod: /usr/local/Cellar/apr/./1.7.0/libexec/lib: No such file or directory
cp: chflags: /usr/local/Cellar/apr/./1.7.0/libexec/lib: No such file or directory
cp: /var/folders/td/nfhj3f6s1tz099djvy3zlj9c0000gs/T/d20190423-40232-1dvoznq/apr/./1.7.0/libexec/lib: unable to copy ACL to /usr/local/Cellar/apr/./1.7.0/libexec/lib: No such file or directory
cp: utimes: /usr/local/Cellar/apr/./1.7.0/libexec: No such file or directory
cp: chown: /usr/local/Cellar/apr/./1.7.0/libexec: No such file or directory
cp: chmod: /usr/local/Cellar/apr/./1.7.0/libexec: No such file or directory
cp: chflags: /usr/local/Cellar/apr/./1.7.0/libexec: No such file or directory
cp: /var/folders/td/nfhj3f6s1tz099djvy3zlj9c0000gs/T/d20190423-40232-1dvoznq/apr/./1.7.0/libexec: unable to copy ACL to /usr/local/Cellar/apr/./1.7.0/libexec: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/LICENSE: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/NOTICE: No such file or directory
cp: /usr/local/Cellar/apr/./1.7.0/README: No such file or directory
cp: utimes: /usr/local/Cellar/apr/./1.7.0: No such file or directory
cp: chown: /usr/local/Cellar/apr/./1.7.0: No such file or directory
cp: chmod: /usr/local/Cellar/apr/./1.7.0: No such file or directory
cp: chflags: /usr/local/Cellar/apr/./1.7.0: No such file or directory
cp: /var/folders/td/nfhj3f6s1tz099djvy3zlj9c0000gs/T/d20190423-40232-1dvoznq/apr/./1.7.0: unable to copy ACL to /usr/local/Cellar/apr/./1.7.0: Permission denied
cp: utimes: /usr/local/Cellar/apr/.: Operation not permitted

Warning: Bottle installation failed: building from source.
==> Downloading https://www.apache.org/dyn/closer.cgi?path=apr/apr-1.7.0.tar.bz2
==> Downloading from http://ftp.kddilabs.jp/infosystems/apache/apr/apr-1.7.0.tar.bz2
######################################################################## 100.0%
Error: An exception occurred within a child process:
  Errno::EACCES: Permission denied @ dir_s_mkdir - /usr/local/Cellar/apr/1.7.0
```

```
Error: Xcode alone is not sufficient on Sierra.
Install the Command Line Tools:
  xcode-select --install
```

# 参考資料
「ITエンジニアとしてのPC初期環境構築 [macOS編] 」に付記したいこと
https://qiita.com/kaizen_nagoya/items/08c9f7e4b968472961fd

brew用の管理者を別IDで設定することの得失
https://qiita.com/kaizen_nagoya/items/4967f6b8cf02952f5f40
### 最後までおよみいただきありがとうございました。
いいね　💚、フォローをお願いします。
####  Thank you very much for reading to the last sentence.
Please press the like icon 💚　and follow me for your happy life.