简体   繁体   English

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

[英]Error installing debugger-linecache in Ruby 1.9.3

I need version 1.0.1 of debugger-linecache for 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. 任何帮助将非常感激,我一直在寻找,但找不到有效的解决方案。

这对你有帮助,对我有用

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

This error means that the selected version of debugger does not support your current Ruby version. 此错误意味着所选版本的debugger不支持您当前的Ruby版本。 There are two solutions: 有两种解决方案:

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

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

The problem was that I was using gemsets incorrectly. 问题是我错误地使用了gemsets。 I knew not having permissions were an issue, as under RVM I shouldn't need sudo to install anything. 我知道没有权限是一个问题,因为在RVM下我不需要sudo来安装任何东西。

rvm gemset use global and then a bundle install did the trick. rvm gemset use global然后bundle install就可以了。

From the below link: 从以下链接:

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

I have installed gem ruby-debug19 and problem solved for me as below: 我已经安装了gem ruby-debug19 ,问题解决了我,如下所示:

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

In my case problem was not related to debugger-linecache directly. 在我的情况下,问题直接与debugger-linecache无关。 Either try upgrading debugger-ruby_core_source or downgrade Ruby by few patchlevels. 尝试升级debugger-ruby_core_source或将Ruby降级为几个debugger-ruby_core_source

I've executed bundle update debugger-linecache . 我已经执行了bundle update debugger-linecache Although I had its newest version in Gemfile.lock, debugger-ruby_core_source has been upgraded to 1.1.5 and debugger-linecache has stopped complaining. 虽然我在Gemfile.lock中有最新版本,但debugger-ruby_core_source已升级到1.1.5并且debugger-linecache已停止抱怨。

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

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 /红宝石/红宝石1.9.3-P448

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

Your Gemfile.lock wasn't written with the same Ruby that you're trying to bundle against. 您的Gemfile.lock不是使用您尝试捆绑的相同Ruby编写的。

bundle update should work by making Bundler look at different versions. bundle update应该通过使Bundler查看不同的版本来工作。

manually build it. 手动构建它。 it works for me https://gist.github.com/4060260 它对我有用https://gist.github.com/4060260

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM