在 Ruby 1.9.3 中安装 debugger-linecache 时出错

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10916784/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-06 05:10:47  来源:igfitidea点击:

Error installing debugger-linecache in Ruby 1.9.3

rubyrubygemsgemruby-1.9.3

提问by Jordan Scales

I need version 1.0.1 of debugger-linecachefor a project, and I am facing the following error when trying to install.

我需要debugger-linecache一个项目的1.0.1 版,并且在尝试安装时遇到以下错误。

trunk ?  gem install debugger-linecache -v '1.0.1'
Building native extensions.  This could take a while...
ERROR:  Error installing debugger-linecache:
    ERROR: Failed to build gem native extension.

        /Users/jordanscales/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb
checking for vm_core.h... no
checking for vm_core.h... no
Makefile creation failed
**************************************************************************
No source for ruby-1.9.3-p194 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
    --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/jordanscales/.rvm/rubies/ruby-1.9.3-p194/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


Gem files will remain installed in /Users/jordanscales/.rvm/gems/ruby-1.9.3-p194/gems/debugger-linecache-1.0.1 for inspection.
Results logged to /Users/jordanscales/.rvm/gems/ruby-1.9.3-p194/gems/debugger-linecache-1.0.1/ext/trace_nums/gem_make.out
trunk ?  

Any help would be extremely appreciated, I have been searching but cannot find a working solution.

任何帮助将不胜感激,我一直在寻找,但找不到有效的解决方案。

回答by ToooooLong

this may help you, it works for me

这可能对你有帮助,它对我有用

gem install debugger-linecache -v '1.1.2' -- --with-ruby-include=$rvm_path/src/ruby-1.9.3-p286/

回答by rcrogers

This error means that the selected version of debuggerdoes not support your current Ruby version. There are two solutions:

此错误表示所选版本debugger不支持您当前的 Ruby 版本。有两种解决方案:

  1. Update the debuggergem via bundle update debugger. New versions of debuggerare backward-compatible with old Ruby versions, so this is the best way to fix it.
  2. Downgrade your Ruby version.
  1. 更新debugger通过宝石bundle update debugger。的新版本debugger向后兼容旧的 Ruby 版本,因此这是修复它的最佳方法。
  2. 降级您的 Ruby 版本。

回答by Pierre Ozoux

Update/Install the gem debugger-ruby_core_source,

更新/安装gem debugger-ruby_core_source

gem install debugger-ruby_core_source

it has been corrected here : https://github.com/cldwalker/debugger-ruby_core_source/pull/7

此处已更正:https: //github.com/cldwalker/debugger-ruby_core_source/pull/7

回答by Jordan Scales

The problem was that I was using gemsets incorrectly. I knew not having permissions were an issue, as under RVM I shouldn't need sudo to install anything.

问题是我错误地使用了 gemset。我知道没有权限是一个问题,因为在 RVM 下我不需要 sudo 来安装任何东西。

rvm gemset use globaland then a bundle installdid the trick.

rvm gemset use global然后 abundle install成功了。

回答by Sumit Munot

From the below link:

从以下链接:

https://github.com/cldwalker/debugger/issues/50

https://github.com/cldwalker/debugger/issues/50

I have installed gem ruby-debug19and problem solved for me as below:

我已经安装了 gem ruby-debug19并为我解决了如下问题:

$ bundle
... -> failed to build debugger-linecache
$ gem install ruby-debug19
$ bundle
... -> all is fine

回答by skalee

In my case problem was not related to debugger-linecachedirectly. Either try upgrading debugger-ruby_core_sourceor downgrade Ruby by few patchlevels.

在我的情况下,问题与debugger-linecache直接无关。尝试debugger-ruby_core_source通过几个补丁级别升级或降级 Ruby。

I've executed bundle update debugger-linecache. Although I had its newest version in Gemfile.lock, debugger-ruby_core_sourcehas been upgraded to 1.1.5 and debugger-linecache has stopped complaining.

我已经执行了bundle update debugger-linecache。虽然我在 Gemfile.lock 中有它的最新版本,debugger-ruby_core_source但已升级到 1.1.5 并且 debugger-linecache 已停止抱怨。

回答by rubyisbeautiful

I installed debugger-ruby_core_source gem, based on perusing old answers here: https://github.com/cldwalker/debugger/issues/12

我安装了 debugger-ruby_core_source gem,基于在这里阅读旧答案:https: //github.com/cldwalker/debugger/issues/12

回答by bilal ahmad

If you are using rvm, then make sure the path lead to ruby, in rvm its rubies folder

如果您使用的是 rvm,请确保路径指向 ruby​​,在 rvm 中其 rubies 文件夹

$rvm_path/rubies/ruby-1.9.3-p448

$rvm_path/rubies/ruby-1.9.3-p448

gem install debugger-linecache -v '1.1.2'  -- --with-ruby-include=$rvm_path/rubies/ruby-1.9.3-p448

回答by Mike Campbell

Your Gemfile.lock wasn't written with the same Ruby that you're trying to bundle against.

您的 Gemfile.lock 不是用您尝试捆绑的同一个 Ruby 编写的。

bundle updateshould work by making Bundler look at different versions.

bundle update应该通过让 Bundler 查看不同版本来工作。

回答by duyvk

manually build it. it works for me https://gist.github.com/4060260

手动构建它。它对我 有用 https://gist.github.com/4060260