安装调试器时出错:无法使用ruby-1.9.3-p362构建gem本机扩展

err*_*ric 25 ruby bundle ruby-on-rails

在尝试为新项目运行bundle时,我遇到以下错误:

Installing debugger (1.2.2) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    C:/Ruby193/bin/ruby.exe 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-p362 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
        --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=C:/Ruby193/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 C:/Ruby193/lib/ruby/gems/1.9.1/gems/debugger-1.2.2 for inspection.
Results logged to C:/Ruby193/lib/ruby/gems/1.9.1/gems/debugger-1.2.2/ext/ruby_debug/gem_make.out
An error occured while installing debugger (1.2.2), and Bundler cannot continue.
Make sure that `gem install debugger -v '1.2.2'` succeeds before bundling.
Run Code Online (Sandbox Code Playgroud)

运行gem install debugger -v '1.2.2'产生相同的结果.

我检查了mkmf.log和gem_make.out文件的内容,而且也没有意义,但如果要求我将发布他们.

为什么这不起作用?

小智 41

我遇到了同样的问题.我试过了:

bundle update debugger

我的Gemfile有这个:

gem 'debugger'

它工作,我没有必要改变Gemfile.bundle的输出显示了这样的东西

...

Installing debugger-ruby_core_source (1.1.6)

Installing debugger-linecache (1.1.2) with native extensions

Installing debugger (1.1.4) with native extensions

...

  • 我不得不执行`gem install debugger-ruby_core_source` (4认同)

err*_*ric 16

该问题的解决方案是简单地安装debugger-ruby_core_source gem - 由github上的eiel组成的debugger-ruby_core_source分叉版本.

经过多次试验和错误(就我而言),我只是

gem install debugger-ruby_core_source -v '1.1.6'
Run Code Online (Sandbox Code Playgroud)

这强制包含p362标头.然后当我运行时bundle,调试器成功构建了本机扩展,并且捆绑器继续它的快乐方式,我也是.

刚一说明,而我用简单的几次,我试了好东西,花了几个小时得到这个之前,我确实来的工作简单的解决方案.


Raf*_*tto 10

也许它更好地使用捆绑更新,在这里工作得很好.

$ bundle update debugger-ruby_core_source

考虑对所有调试器gems使用更新:

$ bundle update debugger


cev*_*ris 6

想了一会儿后,我终于放弃了,取而代之debuggerbyebug.

与pry一起使用:

gem 'pry', group: [:development, :test]
gem 'pry-byebug', group: [:development, :test]
Run Code Online (Sandbox Code Playgroud)

然后,您可以binding.pry在任何想要启动调试器的位置删除语句.