今天我尝试将 JRuby 与 Apache 的 Mahout 一起使用。但是我的调试器有问题。当我把debugger
声明放在一个特定的地方时,它并没有止步于此。它稍后在脚本结束时停止,然后当然没有任何变量可用。这是我的 Gemfile:
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/jruby-1.7.3@mahout/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/jruby-1.7.3@mahout/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
我在我的 OS X 10.8 上安装了带有 RVM 的 JRuby 1.7.3,调用时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
也许安装坏了,或者我做错了什么。任何建议如何解决这个问题?