I faced some issue with Homebrew. I upgraded to Yosemite. After the upgrade, homebrew seems to be broken.
I would run any brew command and get this error
/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 26: /usr/local/Library/brew.rb: Undefined error: 0
How to resolve it?