gem install debugger -v '1.5.0' fails
Asked Answered
A

6

4

I am trying to do bundle in the large project on Mavericks and some gems are broken or something wrong with my environment in spite of this is fresh install of rbenv.

$ gem install debugger -v '1.5.0'
Building native extensions.  This could take a while...
ERROR:  Error installing debugger:
    ERROR: Failed to build gem native extension.

        /Users/samat/.rbenv/versions/1.9.3-p448/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-1.9.3-p448 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.
    ...

Have no idea of what configuration options do I need

In mkmf I see things like

"gcc -I/Users/samat/.rbenv/versions/1.9.3-p448/include/ruby-1.9.1/x86_64-darwin13.0.0 -I/Users/samat/.rbenv/versions/1.9.3-p448/include/ruby-1.9.1/ruby/backward -I/Users/samat/.rbenv/versions/1.9.3-p448/include/ruby-1.9.1 -I. -I/Users/samat/.rbenv/versions/1.9.3-p448/include/ruby-1.9.1/ruby-1.9.3-p448 -I'/Users/samat/.rbenv/versions/1.9.3-p448/include'  -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE  -I'/Users/samat/.rbenv/versions/1.9.3-p448/include'   -O3 -Wno-error=shorten-64-to-32  -pipe   -c conftest.c"
conftest.c:3:10: fatal error: 'method.h' file not found
#include <method.h>
         ^
1 error generated.
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3: #include <method.h>
    ...

I use rbenv,

$ rbenv version
1.9.3-p448 (set by /Users/samat/Documents/bm-git/.ruby-version)
Anglicism answered 29/10, 2013 at 11:13 Comment(1)
It looks like your machine is missing some c/c++ libraries. Do you have libc and libc-devel etc installed?Misapply
S
5

You better to use latest version of debugger, bc issue with your Ruby version was solved.

Sardella answered 29/10, 2013 at 11:21 Comment(0)
U
12

From the debugger page it says that if the ruby source can't be found, it will try to install debugger-ruby_core_source, which is actually what fails for me. I use rbenv, so I according to the debugger gem instructions, I pointed it to the rbenv source.

gem install debugger -- --with-ruby-include=~/.rbenv/versions/1.9.3-p484/include

Urbain answered 6/1, 2014 at 14:11 Comment(1)
The accepted answer didn't work for me, but this did and saved me a day and is really a more useful solution. It's worth noting that the path to the include would vary and brew users might find it somewhere like: /usr/local/var/rbenv/... Thanks!Garman
S
5

You better to use latest version of debugger, bc issue with your Ruby version was solved.

Sardella answered 29/10, 2013 at 11:21 Comment(0)
S
1

There are a lot of issues with Ruby gems and Mavericks. What I have found is that the best bet is to use the apple-gcc42 compiler from homebrew

brew tap homebrew/versions
brew install apple-gcc42

Then force that compiler family to be used when building gems. I put symlinks in my a bin folder in my home directory

cd $HOME/bin
ln -s /usr/local/bin/c++-4.2 c++
ln -s /usr/local/bin/g++-4.2 g++
ln -s /usr/local/bin/gcc-4.2 cc
ln -s /usr/local/bin/gcc-4.2 gcc

You'll need to have your local bin folder on your path.

export PATH=$HOME/bin:$PATH

Then you should be good to go.

Straight answered 29/10, 2013 at 20:12 Comment(2)
After hours of trying to get libv8 and therubyracer installed on Mavericks, this was the solution (aside from $HOME not being set, but that was trivial). Thank you very much.Automobile
Glad it helped James!Straight
H
0

may be this will help you gem install debugger-linecache -v '1.1.2' -- --with-ruby-include=$rvm_path/src/ruby-1.9.3-p286/

Halliburton answered 29/10, 2013 at 12:7 Comment(0)
A
0

Sometimes this issue is related with missing package. Most of the time these files (for instance method.h) belongs to package named libXXX-dev.

It's difficult for us to know what the package contains file. I've recently bumped into a utility to deal with this annoying problem (for those who works with apt-get package manager). The tool is apt-file and you can use it as follow:

  1. Installation: sudo apt-get install apt-file
  2. Updating apt-file db: sudo apt-file update
  3. Looking at file: sudo apt-file search 'method.h'

The result might be:

...
libcxxtools-dev: /usr/include/cxxtools/constmethod.h
libcxxtools-dev: /usr/include/cxxtools/method.h
libcxxtools-dev: /usr/include/cxxtools/unit/testmethod.h
libgcj12-dev: /usr/include/c++/4.6/gcj/method.h
libgcj13-dev: /usr/include/c++/4.7/gcj/method.h
...

In the particular case of debuggergem the missing package is `libcxxtools-dev``

I'm on Debian 3.2.54-2 x86_64 GNU/Linux

Alloy answered 17/5, 2014 at 11:33 Comment(0)
D
0

For me it was an issue of permission.

I was able to solve this issue with

sudo gem install debugger

If this doesn't help you may have to get involved in a dependency rabbit hole.

Deepset answered 11/6, 2014 at 4:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.