title: Ruby 1.8.6 `gem install` segfaults with "abort trap 6"
body: <p>I can't install any gems on my fresh rbenv-installed Ruby 1.8.6 on Mountain Lion. <code>gem install</code> segfaults and the shell prints "Abort trap: 6":</p>
  
  <pre><code>$ RUBYLIB= RUBYOPT= bash
  
  $ gem install --verbose bundler
    GET http://rubygems.org/latest_specs.4.8.gz
    302 Moved Temporarily
    GET http://production.s3.rubygems.org/latest_specs.4.8.gz
    304 Not Modified
    Installing gem bundler-1.3.5
    Abort trap: 6
  </code></pre>
  
  <p>There are <a href="https://stackoverflow.com/questions/6786983/how-do-i-get-gem-install-to-work-on-os-x-lion-with-ruby-1-8-7-without-seg-faul">similar issues reported</a> but the answer to all of them is that they need to use non-Apple GCC 4.2 to build such an old version of Ruby. That doesn't apply to me, since  I've installed GCC with <code>brew install apple-gcc42</code> and rbenv install process picked that up, as evident below:</p>
  
  <pre><code>$ gem env
  RubyGems Environment:
    - RUBYGEMS VERSION: 1.3.7
    - RUBY VERSION: 1.8.6 (2010-09-02 patchlevel 420) [i686-darwin12.3.0]
    - INSTALLATION DIRECTORY: /Users/mislav/.rbenv/versions/1.8.6-p420/lib/ruby/gems/1.8
    - RUBY EXECUTABLE: /Users/mislav/.rbenv/versions/1.8.6-p420/bin/ruby
    - EXECUTABLE DIRECTORY: /Users/mislav/.rbenv/versions/1.8.6-p420/bin
    - RUBYGEMS PLATFORMS:
      - ruby
      - x86-darwin-12
    - GEM PATHS:
       - /Users/mislav/.rbenv/versions/1.8.6-p420/lib/ruby/gems/1.8
       - /Users/mislav/.gem/ruby/1.8
    - GEM CONFIGURATION:
       - "gem" =&gt; "--no-ri --no-rdoc"
    - REMOTE SOURCES:
       - http://rubygems.org/
  
  $ ruby -rrbconfig -e 'puts RbConfig::CONFIG["configure_args"]'
    '--prefix=/Users/mislav/.rbenv/versions/1.8.6-p420'
    'CC=/usr/local/bin/gcc-4.2'
    'CFLAGS=  -Wno-error=shorten-64-to-32'
    'LDFLAGS=-L'\\''/Users/mislav/.rbenv/versions/1.8.6-p420/lib'\\'' '
    'CPPFLAGS=-I'\\''/Users/mislav/.rbenv/versions/1.8.6-p420/include'\\'' '
  
  $ /usr/local/bin/gcc-4.2 --version
    i686-apple-darwin11-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3)
  </code></pre>