Mavericksにアップデートして使えなくなったHomebrewを復旧

Mavericksにしてからmoshが使えなくなってたんですよね。sshで困りはしないからと放置してたのをようやく手当てしました。

command not found

Mavericksに上げてから、homebrewで管理しているコマンドが軒並み「command not found」になってしまいました。moshもrbenvもダメ。理由はよく分かりません。

-bash: mosh: command not found

こんな感じ。調べてみたら、それっぽい記事がいくつも出てくる。まぁ何やかんやでbrew updateをしたり、各パッケージを入れなおす必要があるみたい。

やったこと

ここで先に、moshが動くまでにやった作業だけまとめます。

  1. brew update
  2. XQuarts 2.7.6のインストール
  3. brew update
  4. brew uninstall mobile-shell
  5. brew rm protobuf && brew install protobuf
  6. brew install mobile-shell

こんな感じ。ここから、各作業で起こった顛末を。

Homebrewのアップデート

まずはbrewの状態を確認。

$ brew doctor

Warning: You are using Mac OS X 10.9.
We do not yet provide support for this (unreleased) version.
Error: Homebrew doesn't know what compiler versions ship with your version
of Xcode (5.1.1). Please `brew update` and if that doesn't help, file
an issue with the output of `brew --config`:

なんか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'
...

なんかいっぱい怒られた。再びbrew doctorで確認。

$ brew doctor
Warning: Your XQuartz (2.7.4) is outdated
Please install XQuartz 2.7.6:

XQuartzが古いらしい。XQuartzからダウンロードしてインストールした。

$ brew doctor
Your system is ready to brew.

そしたらreadyらしいんで、改めてupdate。

$ brew update
Updated Homebrew from 84320769 to 0ea0d72a.
==> Updated Formulae
bind

OK!

moshのインストールまで

これで大丈夫かなと思ってmoshコマンド叩いたけど、変わらずnot found。色々調べたら、パッケージを入れなおすといいらしい。

$ brew uninstall mobile-shell
$ brew install mobile-shell
...
==> make install
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [mosh-client] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [install-recursive] Error 1
make: *** [install-recursive] Error 1

そしたらいっぱい怒られた。調べたら、protobufってのに依存してるっぽいので、そちらを入れなおし。

mobile-shell 1.2.4 fails to install on OS X 10.9 · Issue #23992 · Homebrew/homebrew

問題なくprotobufの入れなおしが完了。改めてbrew install mobile-shellを行ったら、こちらも今度は問題なく完了。無事moshコマンドうてました。良かった…

おわり

自分みたいにほとんど素人同然の知識でネットの情報をそのまま叩いてると、何かあった時に凄く困ります。上の処置だって、意味はほとんど分かってないですからね…我ながら恐ろしい。ひとまず使えたから良しとしましょうか…

カテゴリーMac

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です