在尝试为新项目运行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. …Run Code Online (Sandbox Code Playgroud) 这个问题类似于/关于另一个堆栈溢出问题,关于在Ruby中查找类的所有后代.一个很好的问题,我正在寻找的信息 - 除了我下载到rails控制台时:
irb(main):001:0> ActiveSupport::DescendantsTracker.descendants(Object)
=>[]
irb(main):002:0> ObjectSpace.each_object(Class).select { |klass| klass < Object }
=> [IRB::Notifier::AbstractNotifier, IRB::Notifier::ErrUnrecognizedLevel, ...]
Run Code Online (Sandbox Code Playgroud)
那么,为什么ActiveSupport :: DescendantsTracker不返回Object的后代?实施中有什么不同?DescendantsTracker的文档表明:
该模块提供了一个内部实现来跟踪后代,这比通过ObjectSpace迭代更快.
快点?好吧,它必须更快地返回任何东西(对吧?),但它应该返回所提供类的后代.