简体   繁体   English

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

[英]Error installing debugger: Failed to build gem native extension with ruby-1.9.3-p362

While trying run bundle for a new project, I'm encountering the following error: 在尝试为新项目运行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.

Running gem install debugger -v '1.2.2' produces the same results. 运行gem install debugger -v '1.2.2'会产生相同的结果。

I've checked the contents of the mkmf.log and gem_make.out file and they make little sense, but if requested I will post them. 我已经检查了mkmf.log和gem_make.out文件的内容,但它们没什么意义,但是如果要求我会发布它们。

Why doesn't this work? 为什么这不起作用?

I ran into same issue. 我遇到了同样的问题。 I tried: 我试过了:

bundle update debugger

My Gemfile had this: 我的Gemfile有这个:

gem 'debugger'

And it worked, I did not have to change Gemfile. 它工作,我没有必要改变Gemfile。 Output of bundle shows something like this 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

...

The solution to the problem was to simply to install the debugger-ruby_core_source gem - a forked version of debugger-ruby_core_source by eiel on github . 该问题的解决方案是简单地安装debugger-ruby_core_source gem - 由github上的eiel组成的debugger-ruby_core_source分叉版本

After much trial and error (on my part), I simply 经过多次试验和错误(就我而言),我只是

gem install debugger-ruby_core_source -v '1.1.6'

which force the inclusion of the p362 headers. 这强制包含p362标头。 Then when I ran bundle , debugger was successfully built with the native extensions, and bundler continued on it's merry way and so was I. 然后,当我运行bundle ,使用本机扩展成功构建了调试器,并且Bundler继续使用它的快乐方式,因此我也是。

Just a note, while I've used simply several times, I tried several things and spent several hours to get this to work before I actually came to the simple solution. 刚一说明,而我只是用了几次,我试了好东西,花了几个小时得到这个之前,我确实来到了简单的解决方案工作。

Maybe it better use the bundle update, worked fine here. 也许它更好地使用捆绑更新,在这里工作得很好。

$ bundle update debugger-ruby_core_source $ bundle update debugger-ruby_core_source

Consider to use update to all debugger gems: 考虑对所有调试器gems使用更新:

$ bundle update debugger $ bundle update debugger

Apparently debugger is not supported in ruby 2.* so use byebug instead. ruby 2中不支持显式调试器。*因此请使用byebug。 http://edgeguides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-byebug-gem http://edgeguides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-byebug-gem

After trying for a while, I finally gave up and replaced debugger with byebug . 经过一段时间的努力,我终于放弃了并用byebug取代了debugger

To use with pry: 与pry一起使用:

gem 'pry', group: [:development, :test]
gem 'pry-byebug', group: [:development, :test]

You can then drop a binding.pry statement anywhere you want to start the debugger. 然后,您可以在任何要启动调试器的位置删除binding.pry语句。

Just ran into this with Ruby 2.0.0 installed via RVM. 刚刚通过RVM安装了Ruby 2.0.0。 None of the other solutions worked for me. 其他解决方案都不适合我。

RVM will just install with the binaries if they are available, which is faster, but debugger needs the source too 如果二进制文件可用,RVM将只安装二进制文件,速度更快,但调试器也需要源代码

rvm reinstall 2.0.0 --disable-binary

if you would use rvm, make sure you have the right sub version to match debase-ruby_core_source ordebugger-ruby_core_source. 如果你要使用rvm,请确保你有正确的子版本来匹配debase-ruby_core_source ordebugger-ruby_core_source。

ie in debase-ruby_core_source for ruby 2.0.0 only support p195 ,p247, p353,p451,p481,p576. 即在r​​ubase 2.0.0的debase-ruby_core_source中仅支持p195,p247,p353,p451,p481,p576。 above is not supported! 以上不支持!

if your ruby version is not match the source provided. 如果您的ruby版本与提供的源不匹配。 you won't be able to make it through. 你将无法完成它。 (that cause "Can not find the source error!") (导致“无法找到源错误!”)

------------debase-ruby_core_source 0.6.0 vm_Core support list ----------------
../usr/local/rvm/rubies/ruby-2.0.0-p598/lib/ruby/gems/2.0.0/gems/debase-ruby_core_source-0.6.0/lib/debase/ruby_core_source/ruby-2.0.0-p0/vm_core.h
./usr/local/rvm/rubies/ruby-2.0.0-p598/lib/ruby/gems/2.0.0/gems/debase-ruby_core_source-0.6.0/lib/debase/ruby_core_source/ruby-2.0.0-p195/vm_core.h
./usr/local/rvm/rubies/ruby-2.0.0-p598/lib/ruby/gems/2.0.0/gems/debase-ruby_core_source-0.6.0/lib/debase/ruby_core_source/ruby-2.0.0-p247/vm_core.h
./usr/local/rvm/rubies/ruby-2.0.0-p598/lib/ruby/gems/2.0.0/gems/debase-ruby_core_source-0.6.0/lib/debase/ruby_core_source/ruby-2.0.0-p353/vm_core.h
./usr/local/rvm/rubies/ruby-2.0.0-p598/lib/ruby/gems/2.0.0/gems/debase-ruby_core_source-0.6.0/lib/debase/ruby_core_source/ruby-2.0.0-p451/vm_core.h
./usr/local/rvm/rubies/ruby-2.0.0-p598/lib/ruby/gems/2.0.0/gems/debase-ruby_core_source-0.6.0/lib/debase/ruby_core_source/ruby-2.0.0-p481/vm_core.h
./usr/local/rvm/rubies/ruby-2.0.0-p598/lib/ruby/gems/2.0.0/gems/debase-ruby_core_source-0.6.0/lib/debase/ruby_core_source/ruby-2.0.0-p576/vm_core.h
./usr/local/rvm/rubies/ruby-2.0.0-p598/lib/ruby/gems/2.0.0/gems/debase-ruby_core_source-0.6.0/lib/debase/ruby_core_source/ruby-2.1.0-p0/vm_core.h
./usr/local/rvm/rubies/ruby-2.0.0-p598/lib/ruby/gems/2.0.0/gems/debase-ruby_core_source-0.6.0/lib/debase/ruby_core_source/ruby-2.1.1-p76/vm_core.h
./usr/local/rvm/rubies/ruby-2.0.0-p598/lib/ruby/gems/2.0.0/gems/debase-ruby_core_source-0.6.0/lib/debase/ruby_core_source/ruby-2.1.2-p95/vm_core.h
./usr/local/rvm/rubies/ruby-2.0.0-p598/lib/ruby/gems/2.0.0/gems/debase-ruby_core_source-0.6.0/lib/debase/ruby_core_source/ruby-2.1.3-p242/vm_core.h
./usr/local/rvm/rubies/ruby-2.0.0-p598/lib/ruby/gems/2.0.0/gems/debase-ruby_core_source-0.6.0/lib/debase/ruby_core_source/ruby-2.2.0-preview1/vm_core.h

that worked for me: 这对我有用:

$ rvm use 2.0

or to make it default: 或者将其设为默认值:

$ rvm use --default 2.0

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

相关问题 在Rails上安装ruby时出错,无法构建gem本机扩展 - Error while installing ruby on rails,Failed to build gem native extension 安装Ruby-无法构建gem本机扩展 - Installing Ruby - Failed to build gem native extension 安装 Ruby on Rails 时出错:“无法构建 gem 本机扩展” - Error when installing Ruby on Rails: “Failed to build gem native extension” 为什么我在安装 Ruby bundler gem 时收到此错误消息“错误:无法构建 gem 本机扩展”? - Why I obtain this error message installing the Ruby bundler gem “ERROR: Failed to build gem native extension”? 调试器 - 无法构建gem native native ruby​​ 1.8.7 - Debugger - Failed to build gem native extension ruby 1.8.7 无法构建gem本机扩展-在Ruby 2.2.2上安装unicorn gem时出错 - Failed to build gem native extension - error while installing unicorn gem on Ruby 2.2.2 安装ribusb gem时出错-无法生成gem本机扩展 - Error installing ribusb gem - Failed to build gem native extension 安装Gem Error - 无法构建gem原生扩展 - Installing Gem Error - Failed to build gem native extension 安装mysql2 gem时出错:无法构建gem原生扩展 - Error installing mysql2 gem: Failed to build gem native extension 安装pg gem; 错误:无法构建gem原生扩展 - Installing pg gem; ERROR: Failed to build gem native extension
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM