After installing Yosemite, I was unable to run brew or ruby.
I was getting this error on brew update:
/usr/local/bin/brew: /usr/local/Library/brew.r
Take a look at this tutorial here: http://ryantvenge.com/2014/09/ruby-homebrea-yosemite/
It worked for me!