Error debugging jruby

just trying to get up to a breakpoint in a Intellij Idea Jruby project.
Any help/i nsgiht is appreciated. Trying to evaluate for our
organization using Jruby to deploy our Ruby projects o the JVM and
perhaps later tap into Java libs.

I’m running on :

Intellij IDEA 11.1.4
Jruby 1.7 + JRE 64

Mac OS X 10.8.2

java -version
openjdk version “1.7.0-internal”
OpenJDK Runtime Environment (build 1.7.0-internal-b00)
OpenJDK 64-Bit Server VM (build 21.0-b17, mixed mode)

jruby --version
jruby 1.7.0 (1.9.3p203) 2012-10-22 ff1ebbe on OpenJDK 64-Bit Server VM
1.7.0-internal-b00 [darwin-x86_64]

jruby -S gem list

*** LOCAL GEMS ***

actionmailer (3.2.8, 3.1.3)
actionpack (3.2.8, 3.1.3)
activemodel (3.2.8, 3.1.3)
activerecord (3.1.3)
activeresource (3.1.3)
activesupport (3.2.8, 3.2.0, 3.1.3)
ansi (1.4.1)
archive-tar-minitar (0.5.2)
arel (2.2.1)
aws-sdk (1.6.1, 1.5.4)
bson (1.7.0, 1.5.2)
bson_ext (1.7.0)
builder (3.0.0)
bundler (1.2.0.pre.1, 1.1.rc.7, 1.0.21)
cgi_multipart_eof_fix (2.5.0)
columnize (0.3.5)
cucumber (1.1.4)
daemons (1.1.8, 1.1.6)
diff-lcs (1.1.3)
erubis (2.7.0)
eventmachine (0.12.10)
fastthread (1.0.7)
gem_plugin (0.2.3)
gherkin (2.7.3)
haml (3.1.4)
hike (1.2.1)
hoe (2.12.5)
hpricot (0.8.5 java)
httparty (0.8.3)
i18n (0.6.0)
journey (1.0.4)
json (1.7.4, 1.7.3, 1.6.3)
linecache19 (0.5.13, 0.5.12)
mail (2.4.4, 2.3.0)
mime-types (1.19, 1.17.2)
minitest (2.9.1)
minitest-reporters (0.4.0)
mongo (1.7.0, 1.5.2)
mongo_mapper (0.10.1)
monkeybars (1.0.5)
multi_json (1.3.6, 1.0.4)
multi_xml (0.5.1)
nokogiri (1.5.5)
plucky (0.4.4)
polyglot (0.3.3)
rack (1.4.1, 1.4.0, 1.3.5)
rack-cache (1.2, 1.1)
rack-mount (0.8.3)
rack-protection (1.2.0, 1.1.4)
rack-ssl (1.3.2)
rack-test (0.6.1)
rails (3.1.3)
railties (3.1.3)
rake (0.9.2.2, 0.9.2)
rawr (1.4.5)
rdoc (3.11)
redcar (0.11)
redcarpet (2.0.1)
rest-client (1.6.7)
rspec (2.11.0, 2.8.0)
rspec-core (2.11.1, 2.8.0)
rspec-expectations (2.11.2, 2.8.0)
rspec-mocks (2.11.1, 2.8.0)
ruby-debug-base19x (0.11.30.pre10, 0.11.30.pre7, 0.11.30.pre4,
0.11.30.pre2)
ruby-debug-ide (0.4.17.beta8)
ruby-progressbar (0.0.10)
ruby_core_source (0.1.5)
rubyzip (0.9.5)
s4t-utils (1.0.4)
shotgun (0.9)
sinatra (1.3.2, 1.3.1, 1.1.0)
sprockets (2.1.3, 2.0.3)
sqlite3 (1.3.4)
syntax (1.0.0)
teamcity-client (0.0.3)
term-ansicolor (1.0.7)
thin (1.4.1, 1.3.1)
thor (0.14.6)
tilt (1.3.3)
tlsmail (0.0.1)
treetop (1.4.10)
tzinfo (0.3.31)
user-choices (1.1.6.1)
uuidtools (2.1.3, 2.1.2)
xml-simple (1.1.1)
yard (0.7.4)
zencoder (2.4.2)
zip (2.0.2)

here;s the stack:

/Library/Frameworks/JRuby.framework/Versions/1.7.0/bin/jruby --1.9 -X+O
-J-Djruby.reflection=true -J-Djruby.compile.mode=OFF
-J-Djruby.debug.fullTrace=true -e
at_exit{sleep(1)};$stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)
/Users/charles/.gem/jruby/1.9/gems/ruby-debug-ide-0.4.17.beta9/bin/rdebug-ide
–port 49441 –
/Users/charles/IdeaProjects/Ruby/DataUploader/src/specs/test_debuuger.rb
Fast Debugger (ruby-debug-ide 0.4.17.beta9, ruby-debug-base 0.10.3.4)
listens on 127.0.0.1:49441
Context.java:407:in contextCopyLocals': java.lang.NoSuchMethodError: org.jruby.runtime.DynamicScope.getEvalScope()Lorg/jruby/runtime/DynamicScope; from Context.java:284:inframe_locals’
from Context$INVOKER$i$1$0$frame_locals_DBG.gen:-1:in call' from JavaMethod.java:327:incall’
from CachingCallSite.java:326:in cacheAndCall' from CachingCallSite.java:170:incall’
from CallOneArgNode.java:57:in interpret' from LocalAsgnNode.java:123:ininterpret’
from NewlineNode.java:105:in interpret' from BlockNode.java:71:ininterpret’
from ASTInterpreter.java:75:in INTERPRET_METHOD' from InterpretedMethod.java:139:incall’
from CachingCallSite.java:306:in cacheAndCall' from CachingCallSite.java:136:incall’
from CallNoArgNode.java:64:in interpret' from NewlineNode.java:105:ininterpret’
from IfNode.java:118:in interpret' from NewlineNode.java:105:ininterpret’
from IfNode.java:116:in interpret' from NewlineNode.java:105:ininterpret’
from BlockNode.java:71:in interpret' from ASTInterpreter.java:112:inINTERPRET_BLOCK’
from Interpreted19Block.java:209:in evalBlockBody' from Interpreted19Block.java:160:inyield’
from Block.java:130:in yield' from RubyArray.java:1605:ineachCommon’
from RubyArray.java:1612:in each' from RubyArray$INVOKER$i$0$0$each_DBG.gen:-1:incall’
from CachingCallSite.java:143:in callBlock' from CachingCallSite.java:154:incallIter’
from CallNoArgBlockNode.java:64:in interpret' from NewlineNode.java:105:ininterpret’
from ASTInterpreter.java:112:in INTERPRET_BLOCK' from Interpreted19Block.java:209:inevalBlockBody’
from Interpreted19Block.java:160:in yield' from Block.java:130:inyield’
from RubyContinuation.java:107:in enter' from RubyKernel.java:1180:inrbCatch19Common’
from RubyKernel.java:1173:in rbCatch19' from RubyKernel$INVOKER$s$rbCatch19_DBG.gen:-1:incall’
from CachingCallSite.java:177:in callBlock' from CachingCallSite.java:188:incallIter’
from FCallOneArgBlockNode.java:34:in interpret' from NewlineNode.java:105:ininterpret’
from BlockNode.java:71:in interpret' from WhileNode.java:131:ininterpret’
from NewlineNode.java:105:in interpret' from BlockNode.java:71:ininterpret’
from RescueNode.java:228:in executeBody' from RescueNode.java:123:ininterpretWithJavaExceptions’
from RescueNode.java:113:in interpret' from ASTInterpreter.java:75:inINTERPRET_METHOD’
from InterpretedMethod.java:139:in call' from CachingCallSite.java:306:incacheAndCall’
from CachingCallSite.java:136:in call' from CallNoArgNode.java:64:ininterpret’
from NewlineNode.java:105:in interpret' from BlockNode.java:71:ininterpret’
from ASTInterpreter.java:75:in INTERPRET_METHOD' from InterpretedMethod.java:268:incall’
from CachingCallSite.java:366:in cacheAndCall' from CachingCallSite.java:238:incall’
from FCallThreeArgNode.java:40:in interpret' from NewlineNode.java:105:ininterpret’
from BlockNode.java:71:in interpret' from ASTInterpreter.java:75:inINTERPRET_METHOD’
from InterpretedMethod.java:268:in call' from CachingCallSite.java:366:incacheAndCall’
from CachingCallSite.java:238:in call' from CallThreeArgNode.java:61:ininterpret’
from NewlineNode.java:105:in interpret' from ASTInterpreter.java:75:inINTERPRET_METHOD’
from InterpretedMethod.java:112:in call' from InterpretedMethod.java:126:incall’
from RubyClass.java:734:in finvoke' from RuntimeHelpers.java:532:ininvoke’
from RubyBasicObject.java:369:in callMethod' from DebugEventHook.java:571:incallAtLine’
from DebugEventHook.java:558:in callAtLine' from DebugEventHook.java:195:inprocessEvent’
from DebugEventHook.java:97:in eventHandler' from EventHook.java:30:inevent’
from Ruby.java:2778:in callEventHooks' from ASTInterpreter.java:230:incallTraceFunction’
from NewlineNode.java:101:in interpret' from BlockNode.java:71:ininterpret’
from ASTInterpreter.java:75:in INTERPRET_METHOD' from InterpretedMethod.java:204:incall’
from CachingCallSite.java:336:in cacheAndCall' from CachingCallSite.java:179:incallBlock’
from CachingCallSite.java:183:in call' from RubyClass.java:867:innewInstance’
from RubyClass$INVOKER$i$newInstance_DBG.gen:-1:in call' from JavaMethod.java:274:incall’
from CachingCallSite.java:326:in cacheAndCall' from CachingCallSite.java:170:incall’
from CallOneArgNode.java:57:in interpret' from LocalAsgnNode.java:123:ininterpret’
from NewlineNode.java:105:in interpret' from BlockNode.java:71:ininterpret’
from RootNode.java:129:in interpret' from ASTInterpreter.java:120:inINTERPRET_ROOT’
from Ruby.java:797:in runInterpreter' from Ruby.java:2576:inloadFile’
from ExternalScript.java:66:in load' from LoadService.java:329:inload’
from Debugger.java:137:in load' from RubyDebugger.java:207:indebug_load’
from RubyDebugger$INVOKER$s$0$2$debug_load_DBG.gen:-1:in call' from DynamicMethod.java:224:incall’
from DynamicMethod.java:220:in call' from CachingCallSite.java:366:incacheAndCall’
from CachingCallSite.java:238:in call' from FCallThreeArgNode.java:40:ininterpret’
from LocalAsgnNode.java:123:in interpret' from NewlineNode.java:105:ininterpret’
from BlockNode.java:71:in interpret' from ASTInterpreter.java:75:inINTERPRET_METHOD’
from InterpretedMethod.java:182:in call' from CachingCallSite.java:326:incacheAndCall’
from CachingCallSite.java:170:in call' from CallOneArgNode.java:57:ininterpret’
from NewlineNode.java:105:in interpret' from BlockNode.java:71:ininterpret’
from RootNode.java:129:in interpret' from ASTInterpreter.java:120:inINTERPRET_ROOT’
from Ruby.java:797:in runInterpreter' from Ruby.java:2576:inloadFile’
from ExternalScript.java:66:in load' from LoadService.java:329:inload’
from RubyKernel.java:1053:in loadCommon' from RubyKernel.java:1045:inload19’
from RubyKernel$INVOKER$s$0$1$load19_DBG.gen:-1:in call' from DynamicMethod.java:208:incall’
from DynamicMethod.java:204:in call' from CachingCallSite.java:326:incacheAndCall’
from CachingCallSite.java:170:in call' from FCallOneArgNode.java:36:ininterpret’
from NewlineNode.java:105:in interpret' from BlockNode.java:71:ininterpret’
from RootNode.java:129:in interpret' from ASTInterpreter.java:120:inINTERPRET_ROOT’
from Ruby.java:797:in runInterpreter' from Ruby.java:805:inrunInterpreter’
from Ruby.java:644:in runNormally' from Ruby.java:489:inrunFromMain’
from Main.java:375:in doRunFromMain' from Main.java:264:ininternalRun’
from Main.java:230:in run' from Main.java:214:inrun’
from Main.java:194:in `main’

Process finished with exit code 1

Charles M.
[email protected]

I would suggest using pry, especially if you’re evaluating. You could
actually use pry to figure out where your trace failed.

Add the following single line of text where you wish to have a
breakpoint:

require ‘pry’ ; binding.pry

You’ll be in the right context, perform your java exploration, hit
CTRL-D to jump back to execution.

Pry saved me on a big project recently on jruby, where an issue would
occur after 25mn of runtime. Once you realize the faulty block can
have a rescue calling pry, you’re 2mn away from fixing the bug. No ide
involved…

BR

On 11/12/12, Charles M. [email protected] wrote:

Mac OS X 10.8.2
jruby -S gem list
archive-tar-minitar (0.5.2)
diff-lcs (1.1.3)
i18n (0.6.0)
multi_json (1.3.6, 1.0.4)
rails (3.1.3)
rspec-mocks (2.11.1, 2.8.0)
sqlite3 (1.3.4)
uuidtools (2.1.3, 2.1.2)
-J-Djruby.debug.fullTrace=true -e
from JavaMethod.java:327:in call' from CallNoArgNode.java:64:in interpret’
from RubyArray.java:1605:in eachCommon' from RubyContinuation.java:107:in enter’
from BlockNode.java:71:in interpret' from ASTInterpreter.java:75:in INTERPRET_METHOD’
from CallThreeArgNode.java:61:in interpret' from DebugEventHook.java:97:in eventHandler’
from RubyClass.java:867:in newInstance' from Ruby.java:797:in runInterpreter’
from FCallThreeArgNode.java:40:in interpret' from RootNode.java:129:in interpret’
from CachingCallSite.java:326:in cacheAndCall' from Main.java:375:in doRunFromMain’
[email protected]


Christian

interesting , I’ll check it out. I will add that part of evaluating for
us has to be whether one can use something within the confines of an
IDE. That’s part of my Smalltalk tradition or baggage depending on
which way one wants to think of it.

I wonder if this would work from within IDEA? i.e. doing a run in IDEA
not a debug . I’ll try it out.

BTW, I should conclude by letting folks know that my problem has been
resolved. The issue was that I needed to install the following:

ruby-debug-base pre into jruby , which I did via the command line, I
also then had to within IDEA to an upgrade to that gem version. Once
that was done , I was good.

thanks for the feedback.

Charles M.
[email protected]