While installing ruby-debug19 whether with rvm or normal ruby installation, I
often trip into the following error while through
bundle install or just
gem install ruby-debug19
Installing linecache19 (0.5.12) with native extensions Unfortunately, a fatal error has occurred. Please report this error to the Bundler issue tracker at [https://github.com/carlhuda/bundler/issues](https://github.com/carlhuda/bundler/issues) so that we can fix it. Thanks!
/Users/millisami/.rvm/rubies/ruby-1.9.2-head/lib/ruby/site_ruby/1.9 .1/rubygems/installer.rb:552:in `rescue in block in build_extensions’: ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)
/Users/millisami/.rvm/rubies/ruby-1.9.2-head/bin/ruby extconf.rb checking for vm_core.h... no checking for vm_core.h... no ....... ....... .......
So, this is just a note to myself not to google again and again if I trip into
this error again. So, the solution is just
gem install ruby-debug19 --
gem install ruby-debug19 -- --with-ruby-include=$rvm_path/src/ruby-1.9.2-head/ Building native extensions. This could take a while... Fetching: ruby-debug-base19-0.11.25.gem (100%) Building native extensions. This could take a while... Fetching: ruby-debug19-0.11.6.gem (100%) Successfully installed linecache19-0.5.12 Successfully installed ruby-debug-base19-0.11.25 Successfully installed ruby-debug19-0.11.6 3 gems installed
If you’re using rvm, don’t forget to replace the
<ruby-1.9.2-head> with your
choice of ruby.
This also works for non-rvm installs, just chage the —with-ruby-include= value to point to an extracted copy of the source.