Posted over 5 years ago. Visible to the public. Linked content.

Fix "An error occurred while installing debugger-linecache" with Ruby 1.9.3

You're better off using debugger-ruby_core_source:

gem install debugger-ruby_core_source

If you can't do this, try the following.

Here is how to fix the following error when installing the debugger gem fails:

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension

Note: The following example is for a project using Ruby 1.9.3-p448 – adjust accordingly for your project.

  1. Fetch the source for your Ruby version, if you do not yet have it:

    rvm fetch ruby-1.9.3-p448
  2. Install the gem by explicitly telling it where your Ruby's source is located:

    gem install debugger-linecache -v '1.1.2' -- --with-ruby-include=$rvm_path/src/ruby-1.9.3-p448
  3. Resume what you were doing before (probably a bundle install).

Here is how the "full" error looks like when a Bundler installation fails.

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. /home/martin/.rvm/rubies/ruby-1.9.3-p448/bin/ruby extconf.rb checking for vm_core.h... no checking for vm_core.h... no Makefile creation failed ************************************************************************** No source for ruby-1.9.3-p448 provided with debugger-ruby_core_source gem. ************************************************************************** *** 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=/home/martin/.rvm/rubies/ruby-1.9.3-p448/bin/ruby --with-ruby-dir --without-ruby-dir --with-ruby-include --without-ruby-include=${ruby-dir}/include --with-ruby-lib --without-ruby-lib=${ruby-dir}/lib Gem files will remain installed in /home/martin/.rvm/gems/ruby-1.9.3-p448/gems/debugger-linecache-1.1.2 for inspection. Results logged to /home/martin/.rvm/gems/ruby-1.9.3-p448/gems/debugger-linecache-1.1.2/ext/trace_nums/gem_make.out An error occurred while installing debugger-linecache (1.1.2), and Bundler cannot continue. Make sure that `gem install debugger-linecache -v '1.1.2'` succeeds before bundling.

By refactoring problematic code and creating automated tests, makandra can vastly improve the maintainability of your Rails application.

Owner of this card:

Martin Straub
Last edit:
almost 4 years ago
by Arne Hartherz
About this deck:
We are makandra and do test-driven, agile Ruby on Rails software development.
License for source code
Posted by Martin Straub to makandra dev
This website uses cookies to improve usability and analyze traffic.
Accept or learn more