58

I need version 1.0.1 of debugger-linecache for a project, and I am facing the following error when trying to install.

trunk ☺  gem install debugger-linecache -v '1.0.1'
Building native extensions.  This could take a while...
ERROR:  Error installing debugger-linecache:
    ERROR: Failed to build gem native extension.

        /Users/jordanscales/.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.
**************************************************************************
*** 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
    --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=/Users/jordanscales/.rvm/rubies/ruby-1.9.3-p194/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 /Users/jordanscales/.rvm/gems/ruby-1.9.3-p194/gems/debugger-linecache-1.0.1 for inspection.
Results logged to /Users/jordanscales/.rvm/gems/ruby-1.9.3-p194/gems/debugger-linecache-1.0.1/ext/trace_nums/gem_make.out
trunk ☺  

Any help would be extremely appreciated, I have been searching but cannot find a working solution.

Jordan Scales
  • 2,687
  • 4
  • 28
  • 37
  • http://stackoverflow.com/questions/4180541/ruby-debug-wont-install-build-native-extensions – Samy Dindane Jun 06 '12 at 15:01
  • @SamyDindane `trunk ☺ gem install ruby-debug-base19 --version=0.11.23 ERROR: While executing gem ... (Errno::EPERM) Operation not permitted - /Users/jordanscales/.rvm/gems/ruby-1.9.3-p194/gems/linecache19-0.5.12/AUTHORS` – Jordan Scales Jun 06 '12 at 15:11
  • You don't have the permissions apparently. Try as root? – Samy Dindane Jun 06 '12 at 15:27

10 Answers10

127

this may help you, it works for me

gem install debugger-linecache -v '1.1.2' -- --with-ruby-include=$rvm_path/src/ruby-1.9.3-p286/
ToooooLong
  • 1,295
  • 1
  • 8
  • 3
100

This error means that the selected version of debugger does not support your current Ruby version. There are two solutions:

  1. Update the debugger gem via bundle update debugger. New versions of debugger are backward-compatible with old Ruby versions, so this is the best way to fix it.
  2. Downgrade your Ruby version.
rcrogers
  • 2,281
  • 1
  • 17
  • 14
34

Update/Install the gem debugger-ruby_core_source,

gem install debugger-ruby_core_source

it has been corrected here : https://github.com/cldwalker/debugger-ruby_core_source/pull/7

René Höhle
  • 26,716
  • 22
  • 73
  • 82
Pierre Ozoux
  • 780
  • 7
  • 25
5

The problem was that I was using gemsets incorrectly. I knew not having permissions were an issue, as under RVM I shouldn't need sudo to install anything.

rvm gemset use global and then a bundle install did the trick.

Jordan Scales
  • 2,687
  • 4
  • 28
  • 37
4

From the below link:

https://github.com/cldwalker/debugger/issues/50

I have installed gem ruby-debug19 and problem solved for me as below:

$ bundle
... -> failed to build debugger-linecache
$ gem install ruby-debug19
$ bundle
... -> all is fine
Sumit Munot
  • 3,748
  • 1
  • 32
  • 51
3

In my case problem was not related to debugger-linecache directly. Either try upgrading debugger-ruby_core_source or downgrade Ruby by few patchlevels.

I've executed bundle update debugger-linecache. Although I had its newest version in Gemfile.lock, debugger-ruby_core_source has been upgraded to 1.1.5 and debugger-linecache has stopped complaining.

skalee
  • 12,331
  • 6
  • 55
  • 57
2

I installed debugger-ruby_core_source gem, based on perusing old answers here: https://github.com/cldwalker/debugger/issues/12

rubyisbeautiful
  • 1,840
  • 1
  • 16
  • 15
1

If you are using rvm, then make sure the path lead to ruby, in rvm its rubies folder

$rvm_path/rubies/ruby-1.9.3-p448

gem install debugger-linecache -v '1.1.2'  -- --with-ruby-include=$rvm_path/rubies/ruby-1.9.3-p448
bilal ahmad
  • 206
  • 3
  • 9
1

Your Gemfile.lock wasn't written with the same Ruby that you're trying to bundle against.

bundle update should work by making Bundler look at different versions.

Mike Campbell
  • 7,921
  • 2
  • 38
  • 51
0

manually build it. it works for me https://gist.github.com/4060260

duyvk
  • 66
  • 1
  • 3