Question

I've seen very similar problems in other SO questions (e.g. No source for ruby-1.9.2-p321 provided with debugger-ruby_core_source gem) as well as through a Google search, but none of those have helped so far.

I'm using OSX Mavericks (first time mac user) and rbenv (first time using that too). I've git cloned a Rails project which I've previously ran on another laptop (Ubuntu & rvm) fine.

rbenv version: 2.0.0-p451 (which I manually installed)

When I try to bundle install, I get the following:

...
Using debugger-ruby_core_source (1.3.1)

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

    /Users/macuser/.rbenv/versions/2.0.0-p451/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
Makefile creation failed
**************************************************************************
No source for ruby-2.0.0-p451 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
    --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=/Users/macuser/.rbenv/versions/2.0.0-p451/bin/ruby
    --with-ruby-dir
    --without-ruby-dir
    --with-ruby-include=${ruby-dir}/include
    --with-ruby-lib
    --without-ruby-lib=${ruby-dir}/


Gem files will remain installed in /Users/macuser/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/debugger-1.6.5 for inspection.
Results logged to /Users/macuser/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/debugger-1.6.5/ext/ruby_debug/gem_make.out
An error occurred while installing debugger (1.6.5), and Bundler cannot continue.
Make sure that `gem install debugger -v '1.6.5'` succeeds before bundling.

So I then tried running gem install debugger -v '1.6.5', which throws basically the same error as above.

From searching around, here's some things I've unsuccessfully tried:

  1. rake add_source

  2. bundle update debugger

  3. Resetting gemfile.lock

  4. gem install debugger-ruby_core_source

and probably some others too... but nothing seems to work.

Update: Switched my rbenv local environment to ruby 2.1.0 and it worked. Didn't fix the underlying problem, but this is fine I guess

No correct solution

OTHER TIPS

Try install debugger without specifying a version and then run bundle install again.

I had the same error, and it just worked, don't ask me why:

$ gem install debugger
$ bundle install

I ran into what I believe was the same problem while trying to install dubugger with ruby 2.0.0-p598.

The gem debugger-ruby_core_source is a dependency of debugger and provides header files for specific versions of ruby that seem to be used while installing debugger. Look in debugger-ruby_core_source/lib/debugger/ruby_core_source/ to see which versions are supported—the header files are not provided for all ruby versions. In my case, they were not provided for version 2.0.0-p598.

Looking at the README for debugger-ruby_core_source, there is a rake task for adding the required files for ruby versions.

From the command line within the gem's directory, I ran

$ rake add_source VERSION=2.0.0-p598 

When I ran this task the first time, I received an error and was required to install the archive-tar-minitar gem before running the rake task again.

After the rake task added the header files for my version, I was able to successfully install and run debugger.

I am posting here because absolutely nothing worked. The only solution that fixed the problem for me:

Even though we are installing debugger, the error is in installing a requirement, debugger-ruby_core_source.

If you look at the error that is exactly where it raises the issue.

No source for ruby-2.0.0-p451 provided with debugger-ruby_core_source gem.

It is actually quite easy to fix this error. Just run the below command, installing the dependencies, and retry:

gem install debugger-ruby_core_source

Credit for this solution to: FIXED gem install debugger -v ’1.6.2′ No source for ruby

The problem is that your Gemfile.lock lists an old debugger-ruby_core_source gem. That gem needs to know about your specific ruby version, to get the header files correctly, and if the version your bundle install is too old, it won't work.

The correct solution is to update your Gemfile.lock with a new version, by running

bundle update debugger-ruby_core_source

@delba's and @superuseroi's answers basically coming down to using gem to install the debugger-ruby_core_source gem directly from the source - which will pull the latest version, but fixing your bundle will be easier and will also persist in your source control (at least until you next upgrade your Ruby).

Also see this article about common Ruby gem issues

Debugger needs source of the Ruby to work.

So just reinstall the Ruby with source (not bin).

For example:

rvm reinstall 2.0.0 --disable-binary

Thanks all.

rvm list
rvm ruby-2.0.0-p451

Tried bundle install, got errors about not being able to install into non-bare repository, suggesting I remove cache directory; which I did:

rm -rf /usr/local/rvm/gems/ruby-2.0.0-p451/cache/

tried to

rvm gemsest use [my_gemset_name] 

and got the same errors.

ended up using:

rvm gemset use default

and bundle install worked.

there seems to be a problem with the compatibility of ruby version and debugger gem of rails. Running the below command worked for me:

 rvm ruby-2.0.0-p481

If it doesn't work type

 rvm list

will get a list of ruby version. Select an older ruby version, which might work.

To solve this problem, you need reinstall rails' source code. This command will fix the problem:

$ rvm reinstall 2.0.0 --disable-binary

Then, the command $ bundle install will work.


Reference: https://pfonseca.com/error-to-install-debugger-s-gem

Use byebug gem instead of fix my problem very well.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top