gem安装调试器-v '1.5.0'失败

时间:2022-11-13 00:15:23

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.

我正在尝试在Mavericks的大型项目中进行捆绑,一些宝石被破坏或者我的环境出了问题,尽管这是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

在mkmf中,我看到了类似的东西

"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,

$ rbenv version
1.9.3-p448 (set by /Users/samat/Documents/bm-git/.ruby-version)

6 个解决方案

#1


5  

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

您最好使用最新版本的调试器,bc问题与您的Ruby版本解决了。

#2


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.

在调试器页面,它说如果不能找到ruby源代码,它将尝试安装debug -ruby_core_source,这实际上是我失败的地方。我使用rbenv,所以根据调试器gem指令,我将它指向rbenv源。

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

gem安装调试器———with-ruby-include=~/.rbenv/version /1.9.3-p484/include

#3


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

Ruby gems和Mavericks存在许多问题。我发现,最好的办法是使用来自homebrew的苹果-gcc42编译器!

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

然后强制编译器族在构建gems时使用。我把符号链接放在我的文件夹,在我的主目录

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.

您需要在路径上有您的本地bin文件夹。

export PATH=$HOME/bin:$PATH

Then you should be good to go.

那你该走了。

#4


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/

这可能会帮助您安装gem -linecache -v '1.1.2 -- -with-ruby-include=$rvm_path/src/ruby-1.9.3-p286/

#5


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.

有时这个问题与丢失的包有关。大多数时候,这些文件(例如method.h)属于名为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:

我们很难知道这个包包含什么文件。我最近遇到了一个实用程序来处理这个烦人的问题(对于那些使用apt-get包管理器的人来说)。该工具是apt文件,您可以使用它如下:

  1. Installation: sudo apt-get install apt-file
  2. 安装:sudo apt-get install apt-file
  3. Updating apt-file db: sudo apt-file update
  4. 更新apt-file db: sudo apt-file更新
  5. Looking at file: sudo apt-file search 'method.h'
  6. 查看文件: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``

在debuggergem的特殊情况下,丢失的包是“libcxxtools-dev”。

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

我用的是Debian 3.2.54-2 x86_64 GNU/Linux

#6


0  

For me it was an issue of permission.

对我来说,这是一个许可的问题。

I was able to solve this issue with

我能解决这个问题

sudo gem install debugger

sudo gem安装调试器

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

如果这对你没有帮助,你可能不得不卷入一个依赖兔子洞。

#1


5  

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

您最好使用最新版本的调试器,bc问题与您的Ruby版本解决了。

#2


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.

在调试器页面,它说如果不能找到ruby源代码,它将尝试安装debug -ruby_core_source,这实际上是我失败的地方。我使用rbenv,所以根据调试器gem指令,我将它指向rbenv源。

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

gem安装调试器———with-ruby-include=~/.rbenv/version /1.9.3-p484/include

#3


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

Ruby gems和Mavericks存在许多问题。我发现,最好的办法是使用来自homebrew的苹果-gcc42编译器!

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

然后强制编译器族在构建gems时使用。我把符号链接放在我的文件夹,在我的主目录

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.

您需要在路径上有您的本地bin文件夹。

export PATH=$HOME/bin:$PATH

Then you should be good to go.

那你该走了。

#4


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/

这可能会帮助您安装gem -linecache -v '1.1.2 -- -with-ruby-include=$rvm_path/src/ruby-1.9.3-p286/

#5


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.

有时这个问题与丢失的包有关。大多数时候,这些文件(例如method.h)属于名为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:

我们很难知道这个包包含什么文件。我最近遇到了一个实用程序来处理这个烦人的问题(对于那些使用apt-get包管理器的人来说)。该工具是apt文件,您可以使用它如下:

  1. Installation: sudo apt-get install apt-file
  2. 安装:sudo apt-get install apt-file
  3. Updating apt-file db: sudo apt-file update
  4. 更新apt-file db: sudo apt-file更新
  5. Looking at file: sudo apt-file search 'method.h'
  6. 查看文件: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``

在debuggergem的特殊情况下,丢失的包是“libcxxtools-dev”。

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

我用的是Debian 3.2.54-2 x86_64 GNU/Linux

#6


0  

For me it was an issue of permission.

对我来说,这是一个许可的问题。

I was able to solve this issue with

我能解决这个问题

sudo gem install debugger

sudo gem安装调试器

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

如果这对你没有帮助,你可能不得不卷入一个依赖兔子洞。