2
Help us understand the problem. What are the problem?

More than 5 years have passed since last update.

posted at

brew update でundefined method `to_sym' for nil:NilClass時の対処

HomeBrewはMacOS上でパッケージ管理を肩代わりしてくれる愛いやつ。
brew updateでなにかエラー出た時は、以下のコマンドで対処しましょう。

対処コマンド

$ brew doctor

お医者さんです。あとは出力されたメッセージを見つつ順番に対処していきましょう。
以下は、自分の時の対処手順です。

brew update

$ brew update
Error: undefined method `to_sym' for nil:NilClass
Please report this bug:
    https://github.com/mxcl/homebrew/wiki/troubleshooting
/usr/local/Library/Homebrew/cmd/update.rb:103:in `report'
/usr/local/Library/Homebrew/cmd/update.rb:101:in `each_line'
/usr/local/Library/Homebrew/cmd/update.rb:101:in `report'
/usr/local/Library/Homebrew/cmd/update.rb:23:in `update'
/usr/local/Library/brew.rb:95:in `send'
/usr/local/Library/brew.rb:95

なんかでたのでとりあえずお医者さん出動

brew doctor

$ brew doctor
Warning: /Library/Frameworks/Mono.framework detected
This can be picked up by CMake's build system and likely cause the build to
fail. You may need to move this file out of the way to compile CMake.

Warning: No developer tools installed.
You should install the Command Line Tools.
Run `xcode-select --install` to install them.
BIZ2013-0063:~ nishiyama$ xcode-select --install
xcode-select: note: install requested for command line developer tools

Warningへの対処

出力されたWarningは2つ。
* Warning: /Library/Frameworks/Mono.framework detected
* Warning: No developer tools installed.

Warning: /Library/Frameworks/Mono.framework detected

詳細メッセージは以下のとおり

This can be picked up by CMake's build system and likely cause the build to
fail. You may need to move this file out of the way to compile CMake.

意訳すると「CMake時に失敗するかもしれないからどっか他に置け」

MonoFrameworkはMacやLinux上で.netFrameworkを動作させるものだけど一先ず使わないので消すことに。(使う場合は移動させてリンクや環境変数変えたりとかで対処するのだと思います)

ここに書いてあるUninstall用シェルを実行。
http://www.mono-project.com/Mono:OSX

#!/bin/sh -x

#This script removes Mono from an OS X System.  It must be run as root

rm -r /Library/Frameworks/Mono.framework

rm -r /Library/Receipts/MonoFramework-*

for dir in /usr/bin /usr/share/man/man1 /usr/share/man/man3 /usr/share/man/man5; do
   (cd ${dir};
    for i in `ls -al | grep /Library/Frameworks/Mono.framework/ | awk '{print $9}'`; do
      rm ${i}
    done);
done

Warning: No developer tools installed.

詳細メッセージは以下の通り

You should install the Command Line Tools.
Run `xcode-select --install` to install them.
MAC-PC:~ user$ xcode-select --install
xcode-select: note: install requested for command line developer tools

意訳すると「command line developer tool入れろ」

メッセージにあるコマンドを実行してインストール。

$ xcode-select --install

再度 brew doctor

$ brew doctor
Your system is ready to brew.

これで $ brew update 通りました。

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Sign upLogin
2
Help us understand the problem. What are the problem?