title: Why can't heroku install nokogiri 1.6.5, on bamboo stack, using ruby 1.9.2?
body: <p>On my laptop, my version of ruby is:</p>
  
  <pre><code>$ ruby -version
  ruby 1.9.3p551 (2014-11-13 revision 48407) [x86_64-darwin14.0.0]
  </code></pre>
  
  <p>and my version of rails is:</p>
  
  <pre><code>$ ./bin/rails -v
  Rails 3.2.15
  </code></pre>
  
  <p>My Gemfile has an unversioned reference to nokogiri:</p>
  
  <pre><code>$ grep nokogiri Gemfile
  gem "nokogiri"
  </code></pre>
  
  <p>but my Gemfile.lock shows this:</p>
  
  <pre><code>nokogiri (1.6.5)
    mini_portile (~&gt; 0.6.0)
  </code></pre>
  
  <p>I'm on the legacy bamboo stack:</p>
  
  <pre><code>$ heroku info | grep -i stack
  Stack:         bamboo-mri-1.9.2
  </code></pre>
  
  <p>and when I push to heroku (using git-ssh transport):</p>
  
  <pre><code>$ git push heroku master
  </code></pre>
  
  <p>the deployment bombs when it reaches the nokogiri dependency:</p>
  
  <pre><code>   ...
     Installing nokogiri (1.6.5) with native extensions /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/installer.rb:483:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)
  
     /usr/ruby1.9.2/bin/ruby extconf.rb 
     *** extconf.rb failed ***
     Could not create Makefile due to some reason, probably lack of
     necessary libraries and/or headers.  Check the mkmf.log file for more
     details.  You may need configuration options.
  
     Provided configuration options:
      --with-opt-dir
      --without-opt-dir
      --with-opt-include
      --without-opt-include=${opt-dir}/include
      --with-opt-lib
      --without-opt-lib=${opt-dir}/lib
      --with-make-prog
      --without-make-prog
      --srcdir=.
      --curdir
      --ruby=/usr/ruby1.9.2/bin/ruby
      --help
      --clean
     /usr/ruby1.9.2/lib/ruby/1.9.1/mkmf.rb:445:in `try_compile': wrong number of arguments (3 for 2) (ArgumentError)
      from extconf.rb:77:in `block in add_cflags'
      from /usr/ruby1.9.2/lib/ruby/1.9.1/mkmf.rb:481:in `with_cflags'
      from extconf.rb:76:in `add_cflags'
      from extconf.rb:323:in `&lt;main&gt;'
     checking if the C compiler accepts ... 
  
     Gem files will remain installed in /tmp/build_8908ccf0104d2f6073466c3fe2186d76/.bundle/gems/ruby/1.9.1/gems/nokogiri-1.6.5 for inspection.
     Results logged to /tmp/build_8908ccf0104d2f6073466c3fe2186d76/.bundle/gems/ruby/1.9.1/gems/nokogiri-1.6.5/ext/nokogiri/gem_make.out
      from /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/installer.rb:486:in `block in build_extensions'
      from /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/installer.rb:446:in `each'
      from /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/installer.rb:446:in `build_extensions'
      from /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/installer.rb:198:in `install'
      from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/source.rb:95:in `install'
      from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/installer.rb:55:in `block in run'
      from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/spec_set.rb:12:in `block in each'
      from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/spec_set.rb:12:in `each'
      from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/spec_set.rb:12:in `each'
      from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/installer.rb:44:in `run'
      from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/installer.rb:8:in `install'
      from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/cli.rb:225:in `install'
      from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/vendor/thor/task.rb:22:in `run'
      from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
      from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/vendor/thor.rb:246:in `dispatch'
      from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/vendor/thor/base.rb:389:in `start'
      from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/bin/bundle:13:in `&lt;top (required)&gt;'
      from /usr/ruby1.9.2/bin/bundle:19:in `load'
      from /usr/ruby1.9.2/bin/bundle:19:in `&lt;main&gt;'
     FAILED: http://devcenter.heroku.com/articles/bundler
  
  !     Push failed: failed to install gems via Bundler
  !     If the problem persists, see http://help.heroku.com and provide Request ID 6f60ac09-059f-4a33-b913-02e32e2f34e4.
  </code></pre>
  
  <p>Any idea how to resolve this?</p>