JRuby调试器无法按预期工作
问题描述:
今天,我给了JRuby一个尝试与Apache的Mahout一起使用它。但是我对调试器有问题。当我把debugger
陈述放在一个特定的地方时,它并不止于此。它在脚本末尾停止,然后当然没有变量可用。这是我的Gemfile:JRuby调试器无法按预期工作
source 'https://rubygems.org'
platform :jruby do
gem "jruby_mahout"
gem "ruby-debug"
end
这是脚本:
require 'rubygems'
require 'ruby-debug'
puts "I am called"
debugger
puts "I should not be called before the debugger"
但输出是:
I am called
/usr/local/rvm/gems/[email protected]/gems/ruby-debug-base-0.10.4-java/lib/ruby-debug-base.rb:215 warning: tracing (e.g. set_trace_func) will not capture all events without --debug flag
I should not be called
/usr/local/rvm/gems/[email protected]/gems/ruby-debug-0.10.4/cli/ruby-debug/interface.rb:129
finalize if respond_to?(:finalize)
(rdb:1)
我不知道为什么会有这样的警告tracing (e.g. set_trace_func) will not capture all events without --debug flag
,因为我开始与脚本jruby test.rb --debug
我安装JRuby 1.7.3与RVM在我的OS X 10.8,并呼吁jruby -version
当我得到这样的输出:
jruby 1.7.3 (1.9.3p385) 2013-02-21 dac429b on Java HotSpot(TM) 64-Bit Server VM 1.6.0_43-b01-447-11M4203 [darwin-x86_64]
NameError: undefined local variable or method `rsion' for main:Object
(root) at -e:1
也许安装坏了,或者说我做某事错。任何建议如何解决这个问题?
答
我自己解决了它。经过努力了很久,我accidentially推杆之间的--debug
声明:
jruby --debug test.rb
这很奇怪,但现在它按预期工作。