Notice: Trying to access array offset on value of type bool in /home/himariweb/www/wp/wp-content/themes/luxeritas/inc/json-ld.php on line 114

HomeBrewでgitを入れる(エラーから解消まで


Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in /home/himariweb/www/wp/wp-content/themes/luxeritas/inc/wpfunc.php on line 1921

Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in /home/himariweb/www/wp/wp-content/themes/luxeritas/inc/wpfunc.php on line 1921
git入れようと思ってbrewを使ってみたけど、
OSXのアップデート後動かなくなってたみたい
$ brew install git
Error: Could not create /usr/local/Cellar
Check you have permission to write to /usr/local
Error: Git must be installed and in your PATH!
Error: Could not create /usr/local/Cellar
Check you have permission to write to /usr/local

解決法

CLTを入れ直せばいいらしい
sudo rm -rf /Library/Developer/CommandLineTools
xcode-select --install
sudo xcode-select -r
brew install git

再度git install

$ brew install git
You should change the ownership of these directories to your user.
  sudo chown -R $(whoami) /usr/local/include /usr/local/lib /usr/local/lib/pkgconfig
ownershipを変更してと言われる
$ sudo chown -R $(whoami) /usr/local/include /usr/local/lib /usr/local/lib/pkgconfig
ownershipを変更してから再々度git install
$ brew install git
gitはインストールできたみたいだけど色々エラーが出る
・・・
==> Installing dependencies for git: gettext and pcre2
==> Installing git dependency: gettext
==> Downloading https://homebrew.bintray.com/bottles/gettext-0.19.8.1.mojave.bottle.tar.gz
######################################################################## 100.0%
Error: No such file or directory @ dir_chdir - /usr/local/Cellar
Warning: Bottle installation failed: building from source.
==> Downloading https://ftp.gnu.org/gnu/gettext/gettext-0.19.8.1.tar.xz
######################################################################## 100.0%
Error: An exception occurred within a child process:
  Errno::EPERM: Operation not permitted @ dir_s_mkdir - /usr/local/Cellar
brew doctorでチェックしてみる
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: The following directories do not exist:
/usr/local/opt
/usr/local/sbin
/usr/local/Cellar

You should create these directories and change their ownership to your account.
  sudo mkdir -p /usr/local/opt /usr/local/sbin /usr/local/Cellar
  sudo chown -R $(whoami) /usr/local/opt /usr/local/sbin /usr/local/Cellar

Warning: Broken symlinks were found. Remove them with `brew cleanup`:
  /usr/local/bin/scan
  /usr/local/share/man/man1/scan.1
satosinoiMac:himariweb satosi$ brew cleanup
Pruned 2 symbolic links from /usr/local
warningが出てるところのコマンドを実行する。
sudo mkdir -p /usr/local/opt /usr/local/sbin /usr/local/Cellar
sudo chown -R $(whoami) /usr/local/opt /usr/local/sbin /usr/local/Cellar
brew doctorでチェック
Your system is ready to brew.がでたら終了
$ brew doctor
Your system is ready to brew.

参考サイト