1. 起こった こと
Mac OS を
brew install autoconf automake opam caskroom/cask/brew-cask && \ brew cask install caskroom/versions/java7
を実行した
Error: undefined method `<' for nil:NilClass Please report this bug: https://git.io/brew-troubleshooting /usr/local/Library/Homebrew/formula_support.rb:21:in `valid?'
エラー原因と
完全な
2. エラー原因と 解決方法
原因は
brew doctor fails on 10.11.1 · Issue #45233 · Homebrew/legacy-homebrew
brew bundle doesn’t work with the “new brew cask style” · Issue #137 · Homebrew/homebrew-bundle
どちらの
Issue #45233
に、
Check for common issues
に
brew updateを
実行する。
Check for common issues
には2度実行しなさいと 書いてあります。
1回目を実施します。 brew update
結果
Error: /usr/local must be writable!
追記 2017/08/30
どうも、OS Upgrade に より /usr/local の ディレクトリ権限が 変わっていたようです。
以下記事に記載が ありますが、 権限変更での 対処も 可能です。
私は、この 時そのまま先に 進めました。
brew updateをしたら Error: /usr/local must be writable!が 出た - Qiita
Homebrew のupdate が 失敗する 問題 sudo brew update を
実行。 通常の brew で 実行が できなかったので、 sudo を 付与して 実行します。 sudo brew update
結果
brew はPassword: Error: Cowardly refusing to 'sudo brew update' You can use brew with sudo, but only if the brew executable is owned by root. However, this is both not recommended and completely unsupported so do so at your own risk.
brewの 実行コマンド類の 持ち主が root の 場合のみ、 sudo で 実行できると 言っています。
自己責任で変えてと あるので、 変える ことは 見送り、 Check for common issues
に従い先に 進めます。 brew doctor を
実行
brew doctor を実行して 全ての 警告を 解消しなさいと あるので、 実行します。 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 and just ignore them. Thanks! Warning: The /usr/local is not writable. You should probably change the ownership and permissions of /usr/local back to your user account. sudo chown -R $(whoami) /usr/local Warning: The /usr/local directory is not writable. Even if this directory was writable when you installed Homebrew, other software may change permissions on this directory. For example, upgrading to OS X El Capitan has been known to do this. Some versions of the "InstantOn" component of Airfoil or running Cocktail cleanup/optimizations are known to do this as well. You should probably change the ownership and permissions of /usr/local back to your user account. sudo chown -R $(whoami):admin /usr/local Error: Failure while executing: /usr/bin/otool -L /usr/bin/install_name_tool
/usr/local
以下の権限設定が おかしいよと いう 警告が 出力されています。 警告の
通りに、 権限を 変更する
MAC のログインユーザーに /usr/local
ディレクトリの権限を 付与します。 sudo chown -R $(whoami) /usr/local sudo chown -R $(whoami):admin /usr/local
再度、
brew doctorを 実行 brew doctor
結果
エラーがError: Failure while executing: /usr/bin/otool -L /usr/bin/install_name_tool
消えません。
上記エラーで検索すると、 Mac OS X Yosemiteに Homebrewを インストール - @uents blog が ヒットします。
xcodeをインストールすると 解決したと あるので、 xcodeを インストールします。 xcode-select --install
インストール完了 brew doctorを
再度実施 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 and just ignore them. Thanks! Warning: Unbrewed header files were found in /usr/local/include. If you didn't put them there on purpose they could cause problems when building Homebrew formulae, and may need to be deleted. Unexpected header files: /usr/local/include/python3.4m/greenlet/greenlet.h Warning: You have unlinked kegs in your Cellar Leaving kegs unlinked can lead to build-trouble and cause brews that depend on those kegs to fail to run properly once built. Run `brew link` on these: autoconf Warning: Broken symlinks were found. Remove them with `brew prune`: /usr/local/bin/apm /usr/local/bin/atom Warning: Your Homebrew is outdated. You haven't updated for at least 24 hours. This is a long time in brewland! To update Homebrew, run `brew update`.
ために、 brew link
、brew prune
、brew update
を実行しなさいと 出力されました。 brew prune,brew update,brew linkを
実行 brew prune brew update brew link
結果
$ brew prune Pruned 2 symbolic links from /usr/local $ brew update ==> Migrating Homebrew to v0.9.9 remote: Counting objects: 462, done. remote: Compressing objects: 100% (420/420), done. remote: Total 462 (delta 28), reused 284 (delta 17), pack-reused 0 Receiving objects: 100% (462/462), 751.72 KiB | 387.00 KiB/s, done. Resolving deltas: 100% (28/28), done. From https://github.com/Homebrew/brew + 53c5089...0fe6ace master -> origin/master (forced update) HEAD is now at 0fe6ace tests: ensure desc prints short name only if there are conflicts ==> Tapping homebrew/core Cloning into '/usr/local/Library/Taps/homebrew/homebrew-core'... remote: Counting objects: 3664, done. remote: Compressing objects: 100% (3549/3549), done. remote: Total 3664 (delta 16), reused 451 (delta 3), pack-reused 0 Receiving objects: 100% (3664/3664), 2.79 MiB | 506.00 KiB/s, done. Resolving deltas: 100% (16/16), done. Checking connectivity... done. Tapped 3539 formulae (3,690 files, 8.7M) Already up-to-date. $ brew link This command requires a keg argument
brew link は
失敗したようですが、 問題なさそうなので、 brew doctorを 実行 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 and just ignore them. Thanks! Warning: Unbrewed header files were found in /usr/local/include. If you didn't put them there on purpose they could cause problems when building Homebrew formulae, and may need to be deleted. Unexpected header files: /usr/local/include/python3.4m/greenlet/greenlet.h Warning: You have unlinked kegs in your Cellar Leaving kegs unlinked can lead to build-trouble and cause brews that depend on those kegs to fail to run properly once built. Run `brew link` on these: autoconf
追記 2017/08/30
下で実行していますが、 brew link autoconf
実行でWaring は 解消されるかと 思います。
私は当時すっ飛ばして 行きましたが、 それでも 問題なく インストールできました。 あまり
変わってなさそうだが、 試しに 問題となった コマンドを 実施 brew install autoconf automake opam caskroom/cask/brew-cask && \ brew cask install caskroom/versions/java7
結果
==> brew cask install caskroom/cask/brew-cask ==> We need to make Caskroom for the first time at /opt/homebrew-cask/Caskroom ==> We'll set permissions properly so we won't need sudo in the future Password: Error: No available Cask for caskroom/cask/brew-cask Error: nothing to install Warning: autoconf-2.69 already installed, it's just not linked Error: You must `brew link autoconf` before automake can be installed ==> Installing dependencies for opam: ocaml, camlp4, gringo, clasp, aspcud ==> Installing opam dependency: ocaml ==> Downloading https://homebrew.bintray.com/bottles/ocaml-4.02.3.el_capitan.bottle.tar.gz ######################################################################## 100.0% ==> Pouring ocaml-4.02.3.el_capitan.bottle.tar.gz 🍺 /usr/local/Cellar/ocaml/4.02.3: 1,187 files, 112.3M ==> Installing opam dependency: camlp4 ==> Downloading https://homebrew.bintray.com/bottles/camlp4-4.02.3+6.el_capitan.bottle.tar.gz ######################################################################## 100.0% ==> Pouring camlp4-4.02.3+6.el_capitan.bottle.tar.gz 🍺 /usr/local/Cellar/camlp4/4.02.3+6: 164 files, 132.5M ==> Installing opam dependency: gringo ==> Downloading https://homebrew.bintray.com/bottles/gringo-4.5.3.el_capitan.bottle.tar.gz ######################################################################## 100.0% ==> Pouring gringo-4.5.3.el_capitan.bottle.tar.gz 🍺 /usr/local/Cellar/gringo/4.5.3: 7 files, 5.7M ==> Installing opam dependency: clasp ==> Downloading https://homebrew.bintray.com/bottles/clasp-3.1.3.el_capitan.bottle.tar.gz ######################################################################## 100.0% ==> Pouring clasp-3.1.3.el_capitan.bottle.tar.gz 🍺 /usr/local/Cellar/clasp/3.1.3: 5 files, 1011.4K ==> Installing opam dependency: aspcud ==> Downloading https://homebrew.bintray.com/bottles/aspcud-1.9.1.el_capitan.bottle.1.tar.gz ######################################################################## 100.0% ==> Pouring aspcud-1.9.1.el_capitan.bottle.1.tar.gz 🍺 /usr/local/Cellar/aspcud/1.9.1: 10 files, 510.7K ==> Installing opam ==> Downloading https://homebrew.bintray.com/bottles/opam-1.2.2_1.el_capitan.bottle.1.tar.gz ######################################################################## 100.0% ==> Pouring opam-1.2.2_1.el_capitan.bottle.1.tar.gz ==> Caveats OPAM uses ~/.opam by default for its package database, so you need to initialize it first by running (as a normal user): $ opam init Run the following to initialize your environment variables: $ eval `opam config env` To export the needed variables every time, add them to your dotfiles. * On Bash, add them to `~/.bash_profile`. * On Zsh, add them to `~/.zprofile` or `~/.zshrc` instead. Documentation and tutorials are available at https://opam.ocaml.org, or via "man opam" and "opam --help". Bash completion has been installed to: /usr/local/etc/bash_completion.d zsh completion has been installed to: /usr/local/share/zsh/site-functions ==> Summary 🍺 /usr/local/Cellar/opam/1.2.2_1: 30 files, 19.0M
先には
進んだように 思う。 brew link autoconf
を実行しろとの こと?なので 実行 brew link autoconf
結果
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 and just ignore them. Thanks! Warning: Unbrewed header files were found in /usr/local/include. If you didn't put them there on purpose they could cause problems when building Homebrew formulae, and may need to be deleted. Unexpected header files: /usr/local/include/python3.4m/greenlet/greenlet.h
追記 2017/08/30
正直、今も あまり 原因が わかっていないですが、 brew warning caused by greenlet · Issue #38152 · Homebrew/legacy-homebrew に 上記に 関連する issue が 存在します。
homebrew - Brew doctor - “warning: unbrewed header files were found in /usr/local/include”? - Stack Overflow を確認する 限りは、 ゴミヘッダファイルは 削除した ほうが いいのかもしれません。
WARING は
コメント