title: How to reinstall brew on El Capitan?
body: <p>I'm stuck to reinstall brew, ruby on El Capitan. </p>
  
  <p>Actually I didn't remember how exactly it occurs, but I lost my brew and I don't get reinstall it.</p>
  
  <p>This is the message I receive when I try to reinstall it:</p>
  
  <pre><code>ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  &lt;internal:gem_prelude&gt;:1:in `require': cannot load such file -- rubygems.rb (LoadError)
  from &lt;internal:gem_prelude&gt;:1:in `&lt;compiled&gt;'
  </code></pre>
  
  <p>First, some information:</p>
  
  <pre><code>&gt;which ruby
  /usr/local/bin/ruby
  
  &gt;ruby --version
  ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-darwin12.6.0]
  </code></pre>
  
  <p>And, if I try to fix ruby:</p>
  
  <pre><code>&gt;rvm list known
  # MRI Rubies
  [ruby-]1.8.6[-p420]
  [ruby-]1.8.7[-head] # security released on head
  [ruby-]1.9.1[-p431]
  [ruby-]1.9.2[-p330]
  [ruby-]1.9.3[-p551]
  [ruby-]2.0.0[-p643]
  [ruby-]2.1.4
  [ruby-]2.1[.5]
  [ruby-]2.2[.1]
  [ruby-]2.2-head
  ruby-head
  
  &gt;rvm install 2.2
  Searching for binary rubies, this might take some time.
  Found remote file https://rvm_io.global.ssl.fastly.net/binaries/osx/10.11/x86_64/ruby-2.2.1.tar.bz2
  Checking requirements for osx.
  About to install Homebrew, press `Enter` for default installation in `/usr/local`,
  type new path if you wish custom Homebrew installation (the path needs to be writable for user)
  : 
  &lt;internal:gem_prelude&gt;:1:in `require': cannot load such file -- rubygems.rb (LoadError)
      from &lt;internal:gem_prelude&gt;:1:in `&lt;compiled&gt;'
  Requirements installation failed with status: 1.
  </code></pre>
  
  <p>How to proceed now? </p>