72
68

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Yosemiteでbrewが壊れた

Last updated at Posted at 2014-10-22

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

解決!

72
68
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
72
68

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?