title: When trying to install pg gem: Brew bad interpreter error and not existing ruby version
body: <p>I've really made something wrong when re-installing ruby, rails, xcode etc. (maybe even I've deleted my system Ruby installation :/ ) Here's what I have now:</p>
  
  <p>System: OSX 10.8.2 (64-bit)</p>
  
  <p><code>which ruby</code> gives me <code>/usr/local/bin/ruby</code></p>
  
  <p>I have installed <code>ruby 1.9.3p286</code>, <code>Rails 3.2.8</code> and <code>rvm 1.16.17 (stable)</code></p>
  
  <p>I've installed Ruby and Rails by going with this tips: <em>http://hivelogic.com/articles/compiling-ruby-rubygems-and-rails-on-snow-leopard</em> </p>
  
  <p>Next I wanted to run <code>gem install pg</code> but I've got an error: <code>No such file or directory - brew --prefix</code></p>
  
  <p>I've tried hit just the <code>brew</code> command but I've got another error: <code>/usr/local/bin/brew: bad interpreter: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin: no such file or directory</code></p>
  
  <p>So there is my question (I have installed brew earlier) - why it points on this path of 1.8 Ruby if I don't have this version of Ruby installed? Can I somehow change this path to my current one with ruby(that from which ruby command?)? How fix this brew error? Please help!</p>