Eric Filkins Eric Filkins - 1 month ago 12
Ruby Question

An error occurred while installing debugger (1.6.6)

When I run bundle install I get an error when it comes to installing the debugger gem (1.6.6). I'm using ruby 2.1.1 and rails 4.0.4. I'm relatively new to rails and am not sure what could be causing this problem.

Gemfile

Error

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

/usr/local/rvm/rubies/ruby-2.1.1/bin/ruby extconf.rb
checking for rb_method_entry_t.called_id in method.h... no
checking for rb_control_frame_t.method_id in method.h... no
checking for rb_method_entry_t.called_id in method.h... no
checking for rb_control_frame_t.method_id in method.h... no
checking for rb_method_entry_t.called_id in method.h... no
checking for rb_control_frame_t.method_id in method.h... no
Makefile creation failed
*************************************************************

NOTE: If your headers were not found, try passing
--with-ruby-include=PATH_TO_HEADERS

*************************************************************

*** 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=/usr/local/rvm/rubies/ruby-2.1.1/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

extconf failed, exit code 1

Gem files will remain installed in /usr/local/rvm/gems/ruby-2.1.1/gems/debugger-1.6.6 for inspection.
Results logged to /usr/local/rvm/gems/ruby-2.1.1/extensions/x86_64-darwin-12/2.1.0- static/debugger-1.6.6/gem_make.out
An error occurred while installing debugger (1.6.6), and Bundler cannot continue.
Make sure that `gem install debugger -v '1.6.6'` succeeds before bundling.

Answer

EDIT:

Debugger is not fully supported for Ruby 2.x.x.

Issue#118 is popular issue which addresses the same. Though it mentions that debugger 1.6.6 must be supported by Ruby 2.1.1, the users are still encountering the similar errors as you are.

Also, this is especially mentioned in their known issues.

You can try to follow that discussion to troubleshoot your problem.
Additionally, this may help:

rm Gemfile.lock
gem install debugger-ruby_core_source
gem update
bundle install

The other solution in issue discusses the possibility of updating Ruby binary.

If nothing works, and if you can possibly change the ruby/rails versions, I can suggest my current combination:

ruby 2.0.0-p195
rails 4.0.0

They work perfectly fine with debugger gem.