ruby-debug on Ruby 1.9 Gem::Installer::ExtensionBuildError

I’m starting to use Ruby 1.9.2 with ChiliProject now but I kept running into an error during bundle install:

Installing linecache (0.43) with native extensions /home/edavis/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:529:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)

        /home/edavis/.rvm/rubies/ruby-1.9.2-p180/bin/ruby extconf.rb
Can't handle 1.9.x yet
*** 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:

The key message buried in that error is: Can’t handle 1.9.x yet.


After some google-fu I found that you need to use a different ruby-debug gem on 1.9 (which will pull in the 1.9 version of linecache).

# Gemfile
gem 'awesome_print'
group :test do
  gem 'redgreen'
  # Pulls in linecache19 which is 1.9 compatable
  gem 'ruby-debug19', :require => 'ruby-debug', :platforms => :mri_19
  # Pulls in linecache which is 1.8 only
  gem 'ruby-debug', :platforms => :mri_18

Hope this helps someone

One comment

Comments are closed.