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,现在我在运行我的规范时收到以下消息。我正在重新安装这些宝石,因为我需要它们。
忽略调试器语句,在 rspec 上使用 -u 或 --debugger 选项来启用调试
我不知道如何解决这个问题。有任何想法吗?