【发布时间】:2010-03-04 18:40:51
【问题描述】:
Ruby-debug 因中断第 94 行 activesupport-2.3.5/lib/active_support/callbacks.rb 上的“break”ruby 保留字而挂起。
def run(object, options = {}, &terminator)
enumerator = options[:enumerator] || :each
unless block_given?
send(enumerator) { |callback| callback.call(object) }
else
send(enumerator) do |callback|
result = callback.call(object)
break result if terminator.call(result, object) # This line is the culprit
end
end
end
我知道 break 是 Ruby 中的保留字,我很惊讶 ruby-debug 会在每个 ActiveSupport 回调的“break”这个词上中断。这使得我几乎所有的调试都变得毫无用处,因为回调被非常频繁地触发。我不再能够运行我的任何 rspec 测试,因为每个规范都会多次触发回调断点。
这是我当前安装的所有 gem 的列表:http://pastie.org/854538
更新: 我尝试删除 ruby-debug 和 ruby-debug-base ,现在我在运行我的规范时收到以下消息。我正在根据需要重新安装这些 gem。
忽略调试器语句,在 rspec 上使用 -u 或 --debugger 选项来启用调试我不知道如何解决这个问题。有什么想法吗?
【问题讨论】:
标签: ruby-on-rails ruby activesupport