26

Any idea how to fix this?

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

/home/durrantm/.rvm/rubies/ruby-1.9.3-p194/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-p194 provided with debugger-ruby_core_source gem.
**************************************************************************
Michael Durrant
  • 93,410
  • 97
  • 333
  • 497

3 Answers3

74

I had this issue after updating to a newer patch version of ruby. Unfortunately the header files gem "debugger-ruby_core_source" was locked in to an earlier version in the Gemfile.lock so it didn't have the required header files.

All you need to do is update that gem by doing:

bundle update debugger-ruby_core_source

You should be able to bundle install afterwards.

If you aren't using bundler then just install the latest version before trying to install debugger:

gem install debugger-ruby_core_source
Luke
  • 1,639
  • 15
  • 16
  • 1
    tyvm dude... wasted like 30mins running in circles til I found your answer – Sikora Dec 17 '12 at 23:53
  • Same error for me, even after installing `debugger-ruby_core_source` `gem install debugger-ruby_core_source-1.3.5.gem Successfully installed debugger-ruby_core_source-1.3.5 1 gem installed C:\RubyGems\lib\debugGems>gem install ruby-debug-base19x-0.11.29.gem Temporarily enhancing PATH to include DevKit... Building native extensions. This could take a while... ERROR: Error installing ruby-debug-base19x-0.11.29.gem: ERROR: Failed to build gem native extension. C:/Ruby193/bin/ruby.exe extconf.rb checking for vm_core.h... no` – Arpit May 22 '14 at 04:46
  • @Arpit this fix is for the gem 'debugger' [github](https://github.com/cldwalker/debugger) - not sure it works with windows but you could give it a try.... – Luke May 22 '14 at 08:18
  • Yeah.. already installed the `debugger` gem. Now, the question is - How to tell this to RubyMine? (it's still searching for `ruby-debug-base19x`) – Arpit May 22 '14 at 13:18
5

Another option is to switch to using ruby p125, e.g.

rvm install 1.9.3-p125
rvm use 1.9.3-p125 --default

I had ruby 1.9.3-p194 and apparently that doesn't have the debug/linecache I need.

Michael Durrant
  • 93,410
  • 97
  • 333
  • 497
  • 2
    This was a quick hack that I'd no longer recommend as you want to be able to keep moving ruby and rails version forward. Using the above fix by Luke is preferred. – Michael Durrant Apr 27 '13 at 17:41
4

open terminal, go to project directory and remove Gemfile.lock using

 rm Gemfile.lock

to remove Gemfile.lock and run

bundle install 

which will create new Gemfile.lock so its easy to do it :)

worked for me.

Taimoor Changaiz
  • 10,250
  • 4
  • 49
  • 53
  • 2
    You can do "bundle update" instead of removing the Gemfile.lock - this is effectively doing the same thing. – djburdick Dec 10 '13 at 01:17