“<top (required)>"是什么意思?意味着在 Ruby 堆栈跟踪中? [英] What does "<top (required)>" mean in a Ruby stack trace?

查看:33
本文介绍了“<top (required)>"是什么意思?意味着在 Ruby 堆栈跟踪中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Ruby 1.9.2 堆栈跟踪中,我经常看到以 给出的方法,如下面的堆栈部分所示.这是什么意思?我的 Ruby 安装是否被巧妙地破坏了?

In Ruby 1.9.2 stack trace I frequently see the method given as <top (required)>, as in this section of stack below. What does this mean? Is my Ruby install subtly broken?

Could not find abstract-1.0.0 in any of the sources
/usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.13/lib/bundler/spec_set.rb:87:in `block in materialize'
/usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.13/lib/bundler/spec_set.rb:81:in `map!'
/usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.13/lib/bundler/spec_set.rb:81:in `materialize'
/usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.13/lib/bundler/definition.rb:90:in `specs'
/usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.13/lib/bundler/definition.rb:135:in `specs_for'
/usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.13/lib/bundler/definition.rb:124:in `requested_specs'
/usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.13/lib/bundler/environment.rb:23:in `requested_specs'
/usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.13/lib/bundler/runtime.rb:11:in `setup'
/usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.13/lib/bundler.rb:107:in `setup'
/usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.13/lib/bundler/setup.rb:14:in `<top (required)>'
<internal:lib/rubygems/custom_require>:33:in `require'
<internal:lib/rubygems/custom_require>:33:in `rescue in require'
<internal:lib/rubygems/custom_require>:29:in `require'

推荐答案

它是文件的顶层,即在需要文件时运行的任何内容.
因此,如果在设置库过程中出现问题(例如找不到某些必需的文件),它将像这样显示在堆栈跟踪中.

It's the top level of a file i.e. whatever gets run when the file is required.
So if something fails during the setup of a library (for example some required file isn't found) it will show up in the stacktrace like that.

这篇关于“&lt;top (required)&gt;"是什么意思?意味着在 Ruby 堆栈跟踪中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆