【问题标题】:Debugger cannot compile on Ruby 2.0调试器无法在 Ruby 2.0 上编译
【发布时间】:2013-12-02 21:52:18
【问题描述】:

原帖在这里:“How to use the debugger with Ruby 2.0?

我总是回到这里,但我有一个不同的问题。我现在无法更改为 Byebug。我们目前卡在“调试器”上,我无法安装它。

Building native extensions.  This could take a while...
ERROR:  Error installing debugger:
  ERROR: Failed to build gem native extension.

    /Users/mbridges/.rbenv/versions/2.0.0-p247/bin/ruby extconf.rb
*** 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/mbridges/.rbenv/versions/2.0.0-p247/bin/ruby
/Users/mbridges/.rbenv/versions/2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:51:in `require': cannot load such file -- debugger/ruby_core_source (LoadError)
  from /Users/mbridges/.rbenv/versions/2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:51:in `require'
  from extconf.rb:16:in `<main>'

有人有什么想法吗?

【问题讨论】:

  • 为什么不能更改专门用于开发的gem?
  • 你在安装什么 gem?试试 byebug
  • 对 2.0 之后的红宝石使用 debugger 不是一个好主意。我不明白你为什么被困在debugger 上。您无法控制自己的开发环境?
  • 我坚持使用 debugger,因为它是 pry-debugger 的依赖项,我们在开发中非常依赖它。
  • 然后试试pry-byebug

标签: ruby debugging ruby-2.0


【解决方案1】:

更新:现在 Ruby 2.1+ 应该使用 byebug 而不是调试器。

  1. debugger-ruby_core_source 克隆到本地文件夹,例如C:\git\debugger-ruby_core_source
  2. C:\git\debugger-ruby_core_source\lib复制到C:\Ruby200\lib\ruby\gems\2.0.0\gems\debugger-ruby_core_source-1.3.2
  3. 再次运行gem install debugger

我现在确定为什么 gems debugger-ruby_core_source 没有将 lib 复制到该文件夹​​,但肯定是 debugger 需要它。

【讨论】:

    猜你喜欢
    • 2021-12-19
    • 1970-01-01
    • 2012-04-23
    • 2013-01-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-03
    相关资源
    最近更新 更多