title: rbenv fails to install ruby 1.8.7 on MacOS X Sierra
body: <p>After creating a <code>.ruby-version</code> file with <code>1.8.7</code>, running <code>rbenv install</code> on the same directory where the file is gives the following error:</p>
  
  <blockquote>
    <p>ERROR: This package must be compiled with GCC, but ruby-build couldn't
    find a suitable <code>gcc</code> executable on your system. Please install GCC
    and try again.</p>
    
    <p>DETAILS: Apple no longer includes the official GCC compiler with Xcode
    as of version 4.2. Instead, the <code>gcc</code> executable is a symlink to
    <code>llvm-gcc</code>, a modified version of GCC which outputs LLVM bytecode.</p>
    
    <p>For most programs the <code>llvm-gcc</code> compiler works fine. However,
    versions of Ruby older than 1.9.3-p125 are incompatible with
    <code>llvm-gcc</code>. To build older versions of Ruby you must have the official
    GCC compiler installed on your system.</p>
    
    <p>TO FIX THE PROBLEM: Install Homebrew's apple-gcc42 package with this
    command: brew tap homebrew/dupes ; brew install apple-gcc42</p>
    
    <p>You will need to install the official GCC compiler to build older
    versions of Ruby even if you have installed Apple's Command Line Tools
    for Xcode package. The Command Line Tools for Xcode package only
    includes <code>llvm-gcc</code>.</p>
    
    <p>BUILD FAILED (OS X 10.12.4 using ruby-build 20170405-2-g3b15693)</p>
  </blockquote>
  
  <p>Then running <code>brew install apple-gcc42</code> gives:</p>
  
  <blockquote>
    <p>apple-gcc42: This formula either does not compile or function as expected on macOS
    versions newer than Mavericks due to an upstream incompatibility.
    Error: An unsatisfied requirement failed this build.</p>
  </blockquote>
  
  <p>Stuck trying to install ruby 1.8.7 through rbenv on MacOS X Sierra. Any ideas on how to fix this?</p>