読者です 読者をやめる 読者になる 読者になる

/var/log/messages from Tocyuki

IT / MUSIC / BJJ / LIFE / GROUMENT

【解決してなかった】Homebrewが使えなくなった【Mac】

プログラミング Homebrew Mac トラブルシューティング テクノロジー

実は・・・

以下の件、解決しておりませんでした。

tocc.hatenablog.com

一応、今度こそ解決できたっぽいのでその一連の奮闘記を御覧ください。

こんな状態でした

$ 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: /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: /usr/local 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) /usr/local

Warning: Your XQuartz (2.7.7) is outdated
Please install XQuartz 2.7.9:
  https://xquartz.macosforge.org

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:
    lua
    pkg-config
    rbenv
    ruby-build
    vim

Warning: You have uncommitted modifications to Homebrew
If this is a surprise to you, then you should stash these modifications.
Stashing returns Homebrew to a pristine state but can be undone
should you later need to do so for some reason.
  cd /usr/local/Library && git stash && git clean -d -f

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`.

ひとつずつ解決してみる

Warning: /usr/local is not writable.

書いてある通り、sudo chown -R $(whoami) /usr/localを実行して再度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: Your XQuartz (2.7.7) is outdated
Please install XQuartz 2.7.9:
  https://xquartz.macosforge.org

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:
    lua
    pkg-config
    rbenv
    ruby-build
    vim

Warning: You have uncommitted modifications to Homebrew
If this is a surprise to you, then you should stash these modifications.
Stashing returns Homebrew to a pristine state but can be undone
should you later need to do so for some reason.
  cd /usr/local/Library && git stash && git clean -d -f

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`.

該当部分のエラーが消えた!

Warning: Your XQuartz (2.7.7) is outdated

下記からXQuartzをインストールする

https://dl.bintray.com/xquartz/downloads/XQuartz-2.7.9.dmg

再度、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: 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:
    lua
    pkg-config
    rbenv
    ruby-build
    vim

Warning: You have uncommitted modifications to Homebrew
If this is a surprise to you, then you should stash these modifications.
Stashing returns Homebrew to a pristine state but can be undone
should you later need to do so for some reason.
  cd /usr/local/Library && git stash && git clean -d -f

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`.

該当箇所のエラーが消えた!! パターン、パターン見えてきたよ!!!

Warning: You have unlinked kegs in your Cellar

エラー内容に従い、brew linkを下記プログラムに対して実行する

$ brew link lua
Linking /usr/local/Cellar/lua/5.2.4_1... 25 symlinks created
$ brew link pkg-config
Linking /usr/local/Cellar/pkg-config/0.28... 4 symlinks created
$ brew link rbenv
Linking /usr/local/Cellar/rbenv/1.0.0... 2 symlinks created
$ brew link ruby-build
Linking /usr/local/Cellar/ruby-build/20160602... 4 symlinks created
$ brew link vim
Linking /usr/local/Cellar/vim/7.4.873... 122 symlinks created

そして再度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: You have uncommitted modifications to Homebrew
If this is a surprise to you, then you should stash these modifications.
Stashing returns Homebrew to a pristine state but can be undone
should you later need to do so for some reason.
  cd /usr/local/Library && git stash && git clean -d -f

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`.

該当箇所のエラーが消えた!!! いい感じですね!!

Warning: You have uncommitted modifications to Homebrew

書いてある通りに以下のコマンドを実行してみる

$ cd /usr/local/Library && git stash && git clean -d -f
Library/ENV/4.3/cc: needs merge
Library/ENV/4.3/pod2man: needs merge
Library/ENV/pkgconfig/10.10/libcurl.pc: needs merge
Library/ENV/pkgconfig/10.11/libcurl.pc: needs merge
Library/ENV/pkgconfig/10.11/libxml-2.0.pc: needs merge
Library/ENV/pkgconfig/10.11/sqlite3.pc: needs merge
Library/ENV/scm/git: needs merge
Library/Formula: needs merge
Library/Homebrew/README.md: needs merge
Library/Homebrew/blacklist.rb: needs merge
Library/Homebrew/build.rb: needs merge
Library/Homebrew/build_environment.rb: needs merge
Library/Homebrew/build_options.rb: needs merge
Library/Homebrew/caveats.rb: needs merge
Library/Homebrew/checksum.rb: needs merge
Library/Homebrew/cmd/--cache.rb: needs merge
Library/Homebrew/cmd/--cellar.rb: needs merge
Library/Homebrew/cmd/--env.rb: needs merge
Library/Homebrew/cmd/--prefix.rb: needs merge
Library/Homebrew/cmd/--repository.rb: needs merge
Library/Homebrew/cmd/audit.rb: needs merge
Library/Homebrew/cmd/bottle.rb: needs merge
Library/Homebrew/cmd/cat.rb: needs merge
Library/Homebrew/cmd/cleanup.rb: needs merge
Library/Homebrew/cmd/command.rb: needs merge
Library/Homebrew/cmd/commands.rb: needs merge
Library/Homebrew/cmd/config.rb: needs merge
Library/Homebrew/cmd/create.rb: needs merge
Library/Homebrew/cmd/deps.rb: needs merge
Library/Homebrew/cmd/desc.rb: needs merge
Library/Homebrew/cmd/diy.rb: needs merge
Library/Homebrew/cmd/doctor.rb: needs merge
Library/Homebrew/cmd/edit.rb: needs merge
Library/Homebrew/cmd/fetch.rb: needs merge
Library/Homebrew/cmd/gist-logs.rb: needs merge
Library/Homebrew/cmd/help.rb: needs merge
Library/Homebrew/cmd/home.rb: needs merge
Library/Homebrew/cmd/info.rb: needs merge
Library/Homebrew/cmd/install.rb: needs merge
Library/Homebrew/cmd/irb.rb: needs merge
Library/Homebrew/cmd/leaves.rb: needs merge
Library/Homebrew/cmd/link.rb: needs merge
Library/Homebrew/cmd/linkapps.rb: needs merge
Library/Homebrew/cmd/list.rb: needs merge
Library/Homebrew/cmd/log.rb: needs merge
Library/Homebrew/cmd/man.rb: needs merge
Library/Homebrew/cmd/migrate.rb: needs merge
Library/Homebrew/cmd/missing.rb: needs merge
Library/Homebrew/cmd/options.rb: needs merge
Library/Homebrew/cmd/outdated.rb: needs merge
Library/Homebrew/cmd/pin.rb: needs merge
Library/Homebrew/cmd/postinstall.rb: needs merge
Library/Homebrew/cmd/prune.rb: needs merge
Library/Homebrew/cmd/pull.rb: needs merge
Library/Homebrew/cmd/readall.rb: needs merge
Library/Homebrew/cmd/reinstall.rb: needs merge
Library/Homebrew/cmd/search.rb: needs merge
Library/Homebrew/cmd/sh.rb: needs merge
Library/Homebrew/cmd/style.rb: needs merge
Library/Homebrew/cmd/switch.rb: needs merge
Library/Homebrew/cmd/tap-info.rb: needs merge
Library/Homebrew/cmd/tap-pin.rb: needs merge
Library/Homebrew/cmd/tap-readme.rb: needs merge
Library/Homebrew/cmd/tap-unpin.rb: needs merge
Library/Homebrew/cmd/tap.rb: needs merge
Library/Homebrew/cmd/test.rb: needs merge
Library/Homebrew/cmd/tests.rb: needs merge
Library/Homebrew/cmd/uninstall.rb: needs merge
Library/Homebrew/cmd/unlink.rb: needs merge
Library/Homebrew/cmd/unlinkapps.rb: needs merge
Library/Homebrew/cmd/unpack.rb: needs merge
Library/Homebrew/cmd/unpin.rb: needs merge
Library/Homebrew/cmd/untap.rb: needs merge
Library/Homebrew/cmd/upgrade.rb: needs merge
Library/Homebrew/cmd/uses.rb: needs merge
Library/Homebrew/compat.rb: needs merge
Library/Homebrew/compat/formula.rb: needs merge
Library/Homebrew/compat/hardware.rb: needs merge
Library/Homebrew/compat/macos.rb: needs merge
Library/Homebrew/compilers.rb: needs merge
Library/Homebrew/config.rb: needs merge
Library/Homebrew/dependable.rb: needs merge
Library/Homebrew/dependency.rb: needs merge
Library/Homebrew/dependency_collector.rb: needs merge
Library/Homebrew/descriptions.rb: needs merge
Library/Homebrew/dev-cmd/update-test.rb: needs merge
Library/Homebrew/download_strategy.rb: needs merge
Library/Homebrew/exceptions.rb: needs merge
Library/Homebrew/extend/ARGV.rb: needs merge
Library/Homebrew/extend/ENV/shared.rb: needs merge
Library/Homebrew/extend/ENV/std.rb: needs merge
Library/Homebrew/extend/ENV/super.rb: needs merge
Library/Homebrew/extend/fileutils.rb: needs merge
Library/Homebrew/extend/pathname.rb: needs merge
Library/Homebrew/extend/string.rb: needs merge
Library/Homebrew/formula.rb: needs merge
Library/Homebrew/formula_assertions.rb: needs merge
Library/Homebrew/formula_cellar_checks.rb: needs merge
Library/Homebrew/formula_installer.rb: needs merge
Library/Homebrew/formula_lock.rb: needs merge
Library/Homebrew/formula_pin.rb: needs merge
Library/Homebrew/formula_support.rb: needs merge
Library/Homebrew/formula_versions.rb: needs merge
Library/Homebrew/formulary.rb: needs merge
Library/Homebrew/global.rb: needs merge
Library/Homebrew/hardware.rb: needs merge
Library/Homebrew/install_renamed.rb: needs merge
Library/Homebrew/keg.rb: needs merge
Library/Homebrew/keg_relocate.rb: needs merge
Library/Homebrew/language/go.rb: needs merge
Library/Homebrew/language/haskell.rb: needs merge
Library/Homebrew/migrator.rb: needs merge
Library/Homebrew/official_taps.rb: needs merge
Library/Homebrew/options.rb: needs merge
Library/Homebrew/os.rb: needs merge
Library/Homebrew/os/mac.rb: needs merge
Library/Homebrew/os/mac/version.rb: needs merge
Library/Homebrew/os/mac/xcode.rb: needs merge
Library/Homebrew/os/mac/xquartz.rb: needs merge
Library/Homebrew/patch.rb: needs merge
Library/Homebrew/requirement.rb: needs merge
Library/Homebrew/requirements.rb: needs merge
Library/Homebrew/requirements/apr_requirement.rb: needs merge
Library/Homebrew/requirements/emacs_requirement.rb: needs merge
Library/Homebrew/requirements/java_requirement.rb: needs merge
Library/Homebrew/requirements/language_module_requirement.rb: needs merge
Library/Homebrew/requirements/maximum_macos_requirement.rb: needs merge
Library/Homebrew/requirements/ruby_requirement.rb: needs merge
Library/Homebrew/resource.rb: needs merge
Library/Homebrew/sandbox.rb: needs merge
Library/Homebrew/software_spec.rb: needs merge
Library/Homebrew/tab.rb: needs merge
Library/Homebrew/tap.rb: needs merge
Library/Homebrew/tap_constants.rb: needs merge
Library/Homebrew/test/.simplecov: needs merge
Library/Homebrew/test/Gemfile: needs merge
Library/Homebrew/test/Gemfile.lock: needs merge
Library/Homebrew/test/fixtures/receipt.json: needs merge
Library/Homebrew/test/fixtures/updater_fixture.yaml: needs merge
Library/Homebrew/test/lib/config.rb: needs merge
Library/Homebrew/test/tarballs/testball-0.1.tbz: needs merge
Library/Homebrew/test/test_ARGV.rb: needs merge
Library/Homebrew/test/test_ENV.rb: needs merge
Library/Homebrew/test/test_bottle_collector.rb: needs merge
Library/Homebrew/test/test_bottle_hooks.rb: needs merge
Library/Homebrew/test/test_bottle_tag.rb: needs merge
Library/Homebrew/test/test_build_options.rb: needs merge
Library/Homebrew/test/test_caveats.rb: needs merge
Library/Homebrew/test/test_checksum.rb: needs merge
Library/Homebrew/test/test_checksum_verification.rb: needs merge
Library/Homebrew/test/test_compiler_selector.rb: needs merge
Library/Homebrew/test/test_dependency.rb: needs merge
Library/Homebrew/test/test_dependency_collector.rb: needs merge
Library/Homebrew/test/test_dependency_expansion.rb: needs merge
Library/Homebrew/test/test_download_strategies.rb: needs merge
Library/Homebrew/test/test_formula.rb: needs merge
Library/Homebrew/test/test_formula_installer.rb: needs merge
Library/Homebrew/test/test_formula_installer_bottle.rb: needs merge
Library/Homebrew/test/test_formula_pin.rb: needs merge
Library/Homebrew/test/test_formula_spec_selection.rb: needs merge
Library/Homebrew/test/test_formula_support.rb: needs merge
Library/Homebrew/test/test_formulary.rb: needs merge
Library/Homebrew/test/test_hardware.rb: needs merge
Library/Homebrew/test/test_integration_cmds.rb: needs merge
Library/Homebrew/test/test_json.rb: needs merge
Library/Homebrew/test/test_keg.rb: needs merge
Library/Homebrew/test/test_language_module_requirement.rb: needs merge
Library/Homebrew/test/test_migrator.rb: needs merge
Library/Homebrew/test/test_patch.rb: needs merge
Library/Homebrew/test/test_patching.rb: needs merge
Library/Homebrew/test/test_pathname.rb: needs merge
Library/Homebrew/test/test_pkg_version.rb: needs merge
Library/Homebrew/test/test_requirement.rb: needs merge
Library/Homebrew/test/test_resource.rb: needs merge
Library/Homebrew/test/test_software_spec.rb: needs merge
Library/Homebrew/test/test_stdlib.rb: needs merge
Library/Homebrew/test/test_string.rb: needs merge
Library/Homebrew/test/test_tab.rb: needs merge
Library/Homebrew/test/test_utils.rb: needs merge
Library/Homebrew/test/test_versions.rb: needs merge
Library/Homebrew/test/testball.rb: needs merge
Library/Homebrew/test/testball_bottle.rb: needs merge
Library/Homebrew/test/testing_env.rb: needs merge
Library/Homebrew/utils.rb: needs merge
Library/Homebrew/utils/git.rb: needs merge
Library/Homebrew/utils/popen.rb: needs merge
Library/Homebrew/version.rb: needs merge
Library/brew.rb: needs merge
README.md: needs merge
bin/brew: needs merge
share/doc/homebrew/Acceptable-Formulae.md: needs merge
share/doc/homebrew/Bottles.md: needs merge
share/doc/homebrew/Brew-Test-Bot-For-Core-Contributors.md: needs merge
share/doc/homebrew/Brew-Test-Bot.md: needs merge
share/doc/homebrew/Common-Issues.md: needs merge
share/doc/homebrew/External-Commands.md: needs merge
share/doc/homebrew/FAQ.md: needs merge
share/doc/homebrew/Formula-Cookbook.md: needs merge
share/doc/homebrew/Gems,-Eggs-and-Perl-Modules.md: needs merge
share/doc/homebrew/Homebrew-and-Python.md: needs merge
share/doc/homebrew/How-To-Open-a-Homebrew-Pull-Request-(and-get-it-merged).md: needs merge
share/doc/homebrew/How-to-Create-and-Maintain-a-Tap.md: needs merge
share/doc/homebrew/How-to-build-software-outside-Homebrew-with-Homebrew-keg-only-dependencies.md: needs merge
share/doc/homebrew/Installation.md: needs merge
share/doc/homebrew/Interesting-Taps-&-Branches.md: needs merge
share/doc/homebrew/Maintainer-Guidelines.md: needs merge
share/doc/homebrew/Migrating-A-Formula-To-A-Tap.md: needs merge
share/doc/homebrew/New-Maintainer-Checklist.md: needs merge
share/doc/homebrew/Python-for-Formula-Authors.md: needs merge
share/doc/homebrew/Querying-Brew.md: needs merge
share/doc/homebrew/README.md: needs merge
share/doc/homebrew/Rename-A-Formula.md: needs merge
share/doc/homebrew/Tips-N'-Tricks.md: needs merge
share/doc/homebrew/Troubleshooting.md: needs merge
share/doc/homebrew/Xcode.md: needs merge
share/doc/homebrew/brew-tap.md: needs merge
share/doc/homebrew/brew.1.html: needs merge
share/man/man1/brew.1: needs merge
Library/ENV/4.3/cc: needs merge
Library/ENV/4.3/pod2man: needs merge
Library/ENV/pkgconfig/10.10/libcurl.pc: needs merge
Library/ENV/pkgconfig/10.11/libcurl.pc: needs merge
Library/ENV/pkgconfig/10.11/libxml-2.0.pc: needs merge
Library/ENV/pkgconfig/10.11/sqlite3.pc: needs merge
Library/ENV/scm/git: needs merge
Library/Formula: needs merge
Library/Homebrew/README.md: needs merge
Library/Homebrew/blacklist.rb: needs merge
Library/Homebrew/build.rb: needs merge
Library/Homebrew/build_environment.rb: needs merge
Library/Homebrew/build_options.rb: needs merge
Library/Homebrew/caveats.rb: needs merge
Library/Homebrew/checksum.rb: needs merge
Library/Homebrew/cmd/--cache.rb: needs merge
Library/Homebrew/cmd/--cellar.rb: needs merge
Library/Homebrew/cmd/--env.rb: needs merge
Library/Homebrew/cmd/--prefix.rb: needs merge
Library/Homebrew/cmd/--repository.rb: needs merge
Library/Homebrew/cmd/audit.rb: needs merge
Library/Homebrew/cmd/bottle.rb: needs merge
Library/Homebrew/cmd/cat.rb: needs merge
Library/Homebrew/cmd/cleanup.rb: needs merge
Library/Homebrew/cmd/command.rb: needs merge
Library/Homebrew/cmd/commands.rb: needs merge
Library/Homebrew/cmd/config.rb: needs merge
Library/Homebrew/cmd/create.rb: needs merge
Library/Homebrew/cmd/deps.rb: needs merge
Library/Homebrew/cmd/desc.rb: needs merge
Library/Homebrew/cmd/diy.rb: needs merge
Library/Homebrew/cmd/doctor.rb: needs merge
Library/Homebrew/cmd/edit.rb: needs merge
Library/Homebrew/cmd/fetch.rb: needs merge
Library/Homebrew/cmd/gist-logs.rb: needs merge
Library/Homebrew/cmd/help.rb: needs merge
Library/Homebrew/cmd/home.rb: needs merge
Library/Homebrew/cmd/info.rb: needs merge
Library/Homebrew/cmd/install.rb: needs merge
Library/Homebrew/cmd/irb.rb: needs merge
Library/Homebrew/cmd/leaves.rb: needs merge
Library/Homebrew/cmd/link.rb: needs merge
Library/Homebrew/cmd/linkapps.rb: needs merge
Library/Homebrew/cmd/list.rb: needs merge
Library/Homebrew/cmd/log.rb: needs merge
Library/Homebrew/cmd/man.rb: needs merge
Library/Homebrew/cmd/migrate.rb: needs merge
Library/Homebrew/cmd/missing.rb: needs merge
Library/Homebrew/cmd/options.rb: needs merge
Library/Homebrew/cmd/outdated.rb: needs merge
Library/Homebrew/cmd/pin.rb: needs merge
Library/Homebrew/cmd/postinstall.rb: needs merge
Library/Homebrew/cmd/prune.rb: needs merge
Library/Homebrew/cmd/pull.rb: needs merge
Library/Homebrew/cmd/readall.rb: needs merge
Library/Homebrew/cmd/reinstall.rb: needs merge
Library/Homebrew/cmd/search.rb: needs merge
Library/Homebrew/cmd/sh.rb: needs merge
Library/Homebrew/cmd/style.rb: needs merge
Library/Homebrew/cmd/switch.rb: needs merge
Library/Homebrew/cmd/tap-info.rb: needs merge
Library/Homebrew/cmd/tap-pin.rb: needs merge
Library/Homebrew/cmd/tap-readme.rb: needs merge
Library/Homebrew/cmd/tap-unpin.rb: needs merge
Library/Homebrew/cmd/tap.rb: needs merge
Library/Homebrew/cmd/test.rb: needs merge
Library/Homebrew/cmd/tests.rb: needs merge
Library/Homebrew/cmd/uninstall.rb: needs merge
Library/Homebrew/cmd/unlink.rb: needs merge
Library/Homebrew/cmd/unlinkapps.rb: needs merge
Library/Homebrew/cmd/unpack.rb: needs merge
Library/Homebrew/cmd/unpin.rb: needs merge
Library/Homebrew/cmd/untap.rb: needs merge
Library/Homebrew/cmd/upgrade.rb: needs merge
Library/Homebrew/cmd/uses.rb: needs merge
Library/Homebrew/compat.rb: needs merge
Library/Homebrew/compat/formula.rb: needs merge
Library/Homebrew/compat/hardware.rb: needs merge
Library/Homebrew/compat/macos.rb: needs merge
Library/Homebrew/compilers.rb: needs merge
Library/Homebrew/config.rb: needs merge
Library/Homebrew/dependable.rb: needs merge
Library/Homebrew/dependency.rb: needs merge
Library/Homebrew/dependency_collector.rb: needs merge
Library/Homebrew/descriptions.rb: needs merge
Library/Homebrew/dev-cmd/update-test.rb: needs merge
Library/Homebrew/download_strategy.rb: needs merge
Library/Homebrew/exceptions.rb: needs merge
Library/Homebrew/extend/ARGV.rb: needs merge
Library/Homebrew/extend/ENV/shared.rb: needs merge
Library/Homebrew/extend/ENV/std.rb: needs merge
Library/Homebrew/extend/ENV/super.rb: needs merge
Library/Homebrew/extend/fileutils.rb: needs merge
Library/Homebrew/extend/pathname.rb: needs merge
Library/Homebrew/extend/string.rb: needs merge
Library/Homebrew/formula.rb: needs merge
Library/Homebrew/formula_assertions.rb: needs merge
Library/Homebrew/formula_cellar_checks.rb: needs merge
Library/Homebrew/formula_installer.rb: needs merge
Library/Homebrew/formula_lock.rb: needs merge
Library/Homebrew/formula_pin.rb: needs merge
Library/Homebrew/formula_support.rb: needs merge
Library/Homebrew/formula_versions.rb: needs merge
Library/Homebrew/formulary.rb: needs merge
Library/Homebrew/global.rb: needs merge
Library/Homebrew/hardware.rb: needs merge
Library/Homebrew/install_renamed.rb: needs merge
Library/Homebrew/keg.rb: needs merge
Library/Homebrew/keg_relocate.rb: needs merge
Library/Homebrew/language/go.rb: needs merge
Library/Homebrew/language/haskell.rb: needs merge
Library/Homebrew/migrator.rb: needs merge
Library/Homebrew/official_taps.rb: needs merge
Library/Homebrew/options.rb: needs merge
Library/Homebrew/os.rb: needs merge
Library/Homebrew/os/mac.rb: needs merge
Library/Homebrew/os/mac/version.rb: needs merge
Library/Homebrew/os/mac/xcode.rb: needs merge
Library/Homebrew/os/mac/xquartz.rb: needs merge
Library/Homebrew/patch.rb: needs merge
Library/Homebrew/requirement.rb: needs merge
Library/Homebrew/requirements.rb: needs merge
Library/Homebrew/requirements/apr_requirement.rb: needs merge
Library/Homebrew/requirements/emacs_requirement.rb: needs merge
Library/Homebrew/requirements/java_requirement.rb: needs merge
Library/Homebrew/requirements/language_module_requirement.rb: needs merge
Library/Homebrew/requirements/maximum_macos_requirement.rb: needs merge
Library/Homebrew/requirements/ruby_requirement.rb: needs merge
Library/Homebrew/resource.rb: needs merge
Library/Homebrew/sandbox.rb: needs merge
Library/Homebrew/software_spec.rb: needs merge
Library/Homebrew/tab.rb: needs merge
Library/Homebrew/tap.rb: needs merge
Library/Homebrew/tap_constants.rb: needs merge
Library/Homebrew/test/.simplecov: needs merge
Library/Homebrew/test/Gemfile: needs merge
Library/Homebrew/test/Gemfile.lock: needs merge
Library/Homebrew/test/fixtures/receipt.json: needs merge
Library/Homebrew/test/fixtures/updater_fixture.yaml: needs merge
Library/Homebrew/test/lib/config.rb: needs merge
Library/Homebrew/test/tarballs/testball-0.1.tbz: needs merge
Library/Homebrew/test/test_ARGV.rb: needs merge
Library/Homebrew/test/test_ENV.rb: needs merge
Library/Homebrew/test/test_bottle_collector.rb: needs merge
Library/Homebrew/test/test_bottle_hooks.rb: needs merge
Library/Homebrew/test/test_bottle_tag.rb: needs merge
Library/Homebrew/test/test_build_options.rb: needs merge
Library/Homebrew/test/test_caveats.rb: needs merge
Library/Homebrew/test/test_checksum.rb: needs merge
Library/Homebrew/test/test_checksum_verification.rb: needs merge
Library/Homebrew/test/test_compiler_selector.rb: needs merge
Library/Homebrew/test/test_dependency.rb: needs merge
Library/Homebrew/test/test_dependency_collector.rb: needs merge
Library/Homebrew/test/test_dependency_expansion.rb: needs merge
Library/Homebrew/test/test_download_strategies.rb: needs merge
Library/Homebrew/test/test_formula.rb: needs merge
Library/Homebrew/test/test_formula_installer.rb: needs merge
Library/Homebrew/test/test_formula_installer_bottle.rb: needs merge
Library/Homebrew/test/test_formula_pin.rb: needs merge
Library/Homebrew/test/test_formula_spec_selection.rb: needs merge
Library/Homebrew/test/test_formula_support.rb: needs merge
Library/Homebrew/test/test_formulary.rb: needs merge
Library/Homebrew/test/test_hardware.rb: needs merge
Library/Homebrew/test/test_integration_cmds.rb: needs merge
Library/Homebrew/test/test_json.rb: needs merge
Library/Homebrew/test/test_keg.rb: needs merge
Library/Homebrew/test/test_language_module_requirement.rb: needs merge
Library/Homebrew/test/test_migrator.rb: needs merge
Library/Homebrew/test/test_patch.rb: needs merge
Library/Homebrew/test/test_patching.rb: needs merge
Library/Homebrew/test/test_pathname.rb: needs merge
Library/Homebrew/test/test_pkg_version.rb: needs merge
Library/Homebrew/test/test_requirement.rb: needs merge
Library/Homebrew/test/test_resource.rb: needs merge
Library/Homebrew/test/test_software_spec.rb: needs merge
Library/Homebrew/test/test_stdlib.rb: needs merge
Library/Homebrew/test/test_string.rb: needs merge
Library/Homebrew/test/test_tab.rb: needs merge
Library/Homebrew/test/test_utils.rb: needs merge
Library/Homebrew/test/test_versions.rb: needs merge
Library/Homebrew/test/testball.rb: needs merge
Library/Homebrew/test/testball_bottle.rb: needs merge
Library/Homebrew/test/testing_env.rb: needs merge
Library/Homebrew/utils.rb: needs merge
Library/Homebrew/utils/git.rb: needs merge
Library/Homebrew/utils/popen.rb: needs merge
Library/Homebrew/version.rb: needs merge
Library/brew.rb: needs merge
README.md: needs merge
bin/brew: needs merge
share/doc/homebrew/Acceptable-Formulae.md: needs merge
share/doc/homebrew/Bottles.md: needs merge
share/doc/homebrew/Brew-Test-Bot-For-Core-Contributors.md: needs merge
share/doc/homebrew/Brew-Test-Bot.md: needs merge
share/doc/homebrew/Common-Issues.md: needs merge
share/doc/homebrew/External-Commands.md: needs merge
share/doc/homebrew/FAQ.md: needs merge
share/doc/homebrew/Formula-Cookbook.md: needs merge
share/doc/homebrew/Gems,-Eggs-and-Perl-Modules.md: needs merge
share/doc/homebrew/Homebrew-and-Python.md: needs merge
share/doc/homebrew/How-To-Open-a-Homebrew-Pull-Request-(and-get-it-merged).md: needs merge
share/doc/homebrew/How-to-Create-and-Maintain-a-Tap.md: needs merge
share/doc/homebrew/How-to-build-software-outside-Homebrew-with-Homebrew-keg-only-dependencies.md: needs merge
share/doc/homebrew/Installation.md: needs merge
share/doc/homebrew/Interesting-Taps-&-Branches.md: needs merge
share/doc/homebrew/Maintainer-Guidelines.md: needs merge
share/doc/homebrew/Migrating-A-Formula-To-A-Tap.md: needs merge
share/doc/homebrew/New-Maintainer-Checklist.md: needs merge
share/doc/homebrew/Python-for-Formula-Authors.md: needs merge
share/doc/homebrew/Querying-Brew.md: needs merge
share/doc/homebrew/README.md: needs merge
share/doc/homebrew/Rename-A-Formula.md: needs merge
share/doc/homebrew/Tips-N'-Tricks.md: needs merge
share/doc/homebrew/Troubleshooting.md: needs merge
share/doc/homebrew/Xcode.md: needs merge
share/doc/homebrew/brew-tap.md: needs merge
share/doc/homebrew/brew.1.html: needs merge
share/man/man1/brew.1: needs merge
fatal: You need to resolve your current index first
Cannot save the current worktree state

そして再度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: You have uncommitted modifications to Homebrew
If this is a surprise to you, then you should stash these modifications.
Stashing returns Homebrew to a pristine state but can be undone
should you later need to do so for some reason.
  cd /usr/local/Library && git stash && git clean -d -f

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`.

Why Japanese People !!!!!!!!!!!!!!!

なんかマージが必要っていっぱい出てるからそうなると思いましたよ。。。
確認したところ、gitはHomebrew管理になっていないようでした

$ which git
/usr/local/bin/git

というわけで、HomebrewからGitをインストール

$ brew install git
==> Downloading https://homebrew.bintray.com/bottles/git-2.9.0.el_capitan.bottle.tar.gz
######################################################################## 100.0%
==> Pouring git-2.9.0.el_capitan.bottle.tar.gz
==> Caveats
Bash completion has been installed to:
  /usr/local/etc/bash_completion.d

zsh completion has been installed to:
  /usr/local/share/zsh/site-functions

Emacs Lisp files have been installed to:
  /usr/local/share/emacs/site-lisp/git
==> Summary
🍺  /usr/local/Cellar/git/2.9.0: 1,424 files, 31.3M

.bash_profileを作成し、以下内容を記載

$ vim ~/.bash_profile
if [ -f ~/.bashrc ] ; then
. ~/.bashrc
fi

export PATH=/usr/local/bin:$PATH

.bash_profileを読みこませるため、以下のコマンドを実行

$ source ~/.bash_profile

gitのバージョンとPATHを確認

$ git --version
git version 2.9.0
$ which git
/usr/local/bin/git

そして、以下の流れでコマンドを実行

$ cd /usr/local
$ git remote add origin git://github.com/mxcl/homebrew.git
fatal: remote origin already exists.
$ git fetch origin
$ git reset --hard origin/master
error: 'Library/Aliases' appears as both a file and as a directory
error: Library/Aliases: cannot drop to stage #0
HEAD is now at e3b6c96 requirement: update cask wording

この状態で再度以下のコマンドを実行!

$ cd /usr/local/Library && git stash && git clean -d -f

が、だめ・・・!

同じくneeds mergeがいっぱい出てなんかだめ・・・。

とりあえず、闇雲に以下の流れを実施

$ git clean -d -f
$ git reset --hard origin/master
HEAD is now at e3b6c96 requirement: update cask wording

おおお、いい感じじゃないですか??

$ cd /usr/local/Library && git stash && git clean -d -f
No local changes to save

そして・・・、

$ brew doctor
Your system is ready to brew.

やったあああああああ!!!!

おわりに

自分の問題解決能力の低さを露呈するような出来事でした・・・w

しかもなぜ解決できたのかわかっていないところがあるので、内容を見返して根本的な原因を調べていければと思います。

参考情報

qiita.com

pyoonn.hatenablog.com