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

More than 5 years have passed since last update.

posted at

updated at

Organization

Yosemiteでbrewが壊れた

Yosemiteに上げたらbrewがこんなエラー吐くようになりました。

/usr/local/bin/brew: /usr/local/Library/brew.rb: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby: bad interpreter: No such file or directory
/usr/local/bin/brew: line 23: /usr/local/Library/brew.rb: Undefined error: 0

どうやらYosemiteからrubyの1.8が消え去った模様で、下記のようにbrewの実行ファイルにあるrubyへのパスを1.8からcurrent変更してあげるといいみたいですね。

/usr/local/Library/brew.rb(変更前)
#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -W0
...
/usr/local/Library/brew.rb(変更後)
#!/System/Library/Frameworks/Ruby.framework/Versions/current/usr/bin/ruby -W0
...

参考:http://stackoverflow.com/questions/24225959/how-to-get-ruby-homebrew-rvm-to-work-on-yosemite

追記 - brew updateできない

brewのupdateをしようとしたら上記編集したせいでupdateの途中で行われるリモートとのマージが出来ないと怒られたので、変更分をコミットする必要があるみたいです。

cd $(brew –repository)
git add .
git commit -m 'some comment' 
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
68
Help us understand the problem. What are the problem?