Error installing ruby-debug

I did this:

gem install ruby-debug

and got:

Error installing ruby-debug.

ERROR: Failed to build gem native extension.

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.

This solution:

1. make sure you reference the right ruby headers, e.g.

gem install ruby-debug19 — -with-ruby-include=$rvm_path/src/ruby-head/

(make sure you get the right number of hyphens!)

E.g. I had:

gem install ruby-debug — -with-ruby-include=$rvm_path/src/ruby-2.0.0-p195/

did not work. E.g. 

Building native extensions with: ‘-with-ruby-include=/Users/user/src/ruby-2.0.0-p195/’

This could take a while…

ERROR:  Error installing ruby-debug:

ERROR: Failed to build gem native extension.

    /Users/user/.rvm/rubies/ruby-2.0.0-p195/bin/ruby extconf.rb -with-ruby-include=/Users/user/.rvm/src/ruby-2.0.0-p195/

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:

–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/user/.rvm/rubies/ruby-2.0.0-p195/bin/ruby

Gem files will remain installed in /Users/user/.rvm/gems/ruby-2.0.0-p195/gems/linecache-0.46 for inspection.

Results logged to /Users/user/.rvm/gems/ruby-2.0.0-p195/gems/linecache-0.46/ext/gem_make.out

The mkmf.log at:

/Users/user/.rvm/gems/ruby-2.0.0-p195/gems/debugger-1.6.0/ext/ruby_debug/mkmf.log

didn’t shed much light.

I followed this:

http://dirk.net/2010/04/17/ruby-debug-with-ruby-19x-and-rails-3-on-rvm/

In the end I went with pry which rocks:

http://www.ruby-forum.com/topic/4406666

“Nothing beats throwing binding.pry in the middle of everything and

figuring out what’s going on from a  ‘live’ server, such as times when

something is going wrong in a model or controller or a decorator I

will throw a binding.pry in there and visit the page and follow the

tracks all the way down the line until I run into that line that is

causing the problem and then test what fixes it, write a test and fix

the code with the edit command and go on about my day.”

Leave a Reply

Your email address will not be published. Required fields are marked *