Problem installing debug gem Win7 64 JRuby

I was attempting to debug a JRuby application and the code runs but not debug. The problem is when attempting to install the ruby-debug-ide gem it fails to build the native extension:

Error running load_couchdb:
Failed to Install Gems. Following gems were not installed:
C:/Program Files (x86)/JetBrains/RubyMine 4.5.4/rb/gems/ruby-debug-ide-0.4.17.beta14.gem: Error installing ruby-debug-ide-0.4.17.beta14.gem:
ERROR: Failed to build gem native extension. C:/jruby/bin/jruby.exe mkrf_conf.rb Gem files will remain installed in C:/jruby/lib/ruby/gems/shared/gems/ruby-debug-ide-0.4.17.beta14 for inspection. Results logged to C:/jruby/lib/ruby/gems/shared/gems/ruby-debug-ide-0.4.17.beta14/ext/gem_make.out

The ruby debug-base gem seems to have installed correctly: ruby-debug-base (0.10.5.rc2 java, 0.10.5.jb2 mswin32)

It does suggest installing the Ruby devkit but I dont believe that would help for Jruby and I have attempted to install manually, setup the VS environment but to no avail.

Is there a manual procedure for installing the gem so that I can debug Jruby code?

Harley Mackenzie

2 comments
Comment actions Permalink

This is for normal Ruby on Windows x64, but it might be relevant to your problem:

I found that I got these types of errors if I installed to the default location, which had spaces or other characters in the file directory names. I uninstalled, then reinstalled on a different drive, but on the root directory and with no spaces in the file name. Hey presto, the errors stopped and it was able to find gems.

The other thing to note is that the "Program Files (x86)" directory is a system directory and unless a program running in it has hightened privledges, it will have trouble working in the directory and that will also lead to errors. This is especially relevant when you start running stuff from the command line.

All of this is why I decided to just run a Ubuntu VM and develop on that instead - it has improved my productivity no end, and I have a template to work from any time I start a project too. Rubymine runs just as fast in a VM if you give it all your cores and set it up right (and also make sure you install Oracle Java SDK 7 and not go with the defualt Open JDK).

Possbly all irrelevant, but I thought I would post just in case it might be helpful :)

0
Comment actions Permalink

Hi Harley,

In terms of manual install you could try this (Win7 64):


jruby -S gem install ruby-debug-base
jruby -S gem install ruby-debug-ide


However, when I insert breakpoint I then get either a stackdump as shown below - or the IntelliJ won't allow the debugger to step through the code or examine variables.

Regards,

Ross.

Exception in DebugThread loop: Bad file descriptor - Bad file descriptor
Backtrace:
org/jruby/RubyIO.java:2054:in `close'
  from: D:/opt/jruby-1.7.0/lib/ruby/gems/shared/gems/ruby-debug-ide-0.4.17.beta9/lib/ruby-debug-ide/interface.rb:43:in `close'
  from: D:/opt/jruby-1.7.0/lib/ruby/gems/shared/gems/ruby-debug-ide-0.4.17.beta9/lib/ruby-debug-ide/ide_processor.rb:102:in `process_commands'
  from: D:/opt/jruby-1.7.0/lib/ruby/gems/shared/gems/ruby-debug-ide-0.4.17.beta9/bin/../lib/ruby-debug-ide.rb:149:in `start_control'
  from: org/jruby/RubyProc.java:261:in `call'
  from: org/jruby/RubyProc.java:213:in `call'
Context.java:407:in `contextCopyLocals': java.lang.NoSuchMethodError: org.jruby.runtime.DynamicScope.getEvalScope()Lorg/jruby/runtime/DynamicScope;
 from Context.java:284:in `frame_locals'
 from Context$INVOKER$i$1$0$frame_locals_DBG.gen:-1:in `call'
 from JavaMethod.java:327:in `call'
 from CachingCallSite.java:326:in `cacheAndCall'
 from CachingCallSite.java:170:in `call'
 from CallOneArgNode.java:57:in `interpret'
 from LocalAsgnNode.java:123:in `interpret'
 from NewlineNode.java:105:in `interpret'
 from BlockNode.java:71:in `interpret'
 from ASTInterpreter.java:75:in `INTERPRET_METHOD'
 from InterpretedMethod.java:139:in `call'
 from CachingCallSite.java:306:in `cacheAndCall'
 from CachingCallSite.java:136:in `call'
 from CallNoArgNode.java:64:in `interpret'
 from NewlineNode.java:105:in `interpret'
 from IfNode.java:118:in `interpret'
 from NewlineNode.java:105:in `interpret'
 from IfNode.java:116:in `interpret'
 from NewlineNode.java:105:in `interpret'
 from BlockNode.java:71:in `interpret'
 from ASTInterpreter.java:112:in `INTERPRET_BLOCK'
 from Interpreted19Block.java:209:in `evalBlockBody'
 from Interpreted19Block.java:160:in `yield'
 from Block.java:130:in `yield'
 from RubyArray.java:1605:in `eachCommon'
 from RubyArray.java:1612:in `each'
 from RubyArray$INVOKER$i$0$0$each_DBG.gen:-1:in `call'
 from CachingCallSite.java:143:in `callBlock'
 from CachingCallSite.java:154:in `callIter'
 from CallNoArgBlockNode.java:64:in `interpret'
 from NewlineNode.java:105:in `interpret'
 from ASTInterpreter.java:112:in `INTERPRET_BLOCK'
 from Interpreted19Block.java:209:in `evalBlockBody'
 from Interpreted19Block.java:160:in `yield'
 from Block.java:130:in `yield'
 from RubyContinuation.java:107:in `enter'
 from RubyKernel.java:1180:in `rbCatch19Common'
 from RubyKernel.java:1173:in `rbCatch19'
 from RubyKernel$INVOKER$s$rbCatch19_DBG.gen:-1:in `call'
 from CachingCallSite.java:177:in `callBlock'
 from CachingCallSite.java:188:in `callIter'
 from FCallOneArgBlockNode.java:34:in `interpret'
 from NewlineNode.java:105:in `interpret'
 from BlockNode.java:71:in `interpret'
 from WhileNode.java:131:in `interpret'
 from NewlineNode.java:105:in `interpret'
 from BlockNode.java:71:in `interpret'
 from RescueNode.java:228:in `executeBody'
 from RescueNode.java:123:in `interpretWithJavaExceptions'
 from RescueNode.java:113:in `interpret'
 from ASTInterpreter.java:75:in `INTERPRET_METHOD'
 from InterpretedMethod.java:139:in `call'
 from CachingCallSite.java:306:in `cacheAndCall'
 from CachingCallSite.java:136:in `call'
 from CallNoArgNode.java:64:in `interpret'
 from NewlineNode.java:105:in `interpret'
 from BlockNode.java:71:in `interpret'
 from ASTInterpreter.java:75:in `INTERPRET_METHOD'
 from InterpretedMethod.java:268:in `call'
 from CachingCallSite.java:366:in `cacheAndCall'
 from CachingCallSite.java:238:in `call'
 from FCallThreeArgNode.java:40:in `interpret'
 from NewlineNode.java:105:in `interpret'
 from BlockNode.java:71:in `interpret'
 from ASTInterpreter.java:75:in `INTERPRET_METHOD'
 from InterpretedMethod.java:268:in `call'
 from CachingCallSite.java:366:in `cacheAndCall'
 from CachingCallSite.java:238:in `call'
 from CallThreeArgNode.java:61:in `interpret'
 from NewlineNode.java:105:in `interpret'
 from ASTInterpreter.java:75:in `INTERPRET_METHOD'
 from InterpretedMethod.java:112:in `call'
 from InterpretedMethod.java:126:in `call'
 from RubyClass.java:734:in `finvoke'
 from RuntimeHelpers.java:532:in `invoke'
 from RubyBasicObject.java:369:in `callMethod'
 from DebugEventHook.java:566:in `callAtLine'
 from DebugEventHook.java:553:in `callAtLine'
 from DebugEventHook.java:190:in `processEvent'
 from DebugEventHook.java:97:in `eventHandler'
 from EventHook.java:30:in `event'
 from Ruby.java:2778:in `callEventHooks'
 from ASTInterpreter.java:230:in `callTraceFunction'
 from NewlineNode.java:101:in `interpret'
 from BlockNode.java:71:in `interpret'
 from RootNode.java:129:in `interpret'
 from ASTInterpreter.java:120:in `INTERPRET_ROOT'
 from Ruby.java:797:in `runInterpreter'
 from Ruby.java:2576:in `loadFile'
 from ExternalScript.java:66:in `load'
 from LoadService.java:329:in `load'
 from Debugger.java:137:in `load'
 from RubyDebugger.java:207:in `debug_load'
 from RubyDebugger$INVOKER$s$0$2$debug_load_DBG.gen:-1:in `call'
 from DynamicMethod.java:224:in `call'
 from DynamicMethod.java:220:in `call'
 from CachingCallSite.java:366:in `cacheAndCall'
 from CachingCallSite.java:238:in `call'
 from FCallThreeArgNode.java:40:in `interpret'
 from LocalAsgnNode.java:123:in `interpret'
 from NewlineNode.java:105:in `interpret'
 from BlockNode.java:71:in `interpret'
 from ASTInterpreter.java:75:in `INTERPRET_METHOD'
 from InterpretedMethod.java:182:in `call'
 from CachingCallSite.java:326:in `cacheAndCall'
 from CachingCallSite.java:170:in `call'
 from CallOneArgNode.java:57:in `interpret'
 from NewlineNode.java:105:in `interpret'
 from BlockNode.java:71:in `interpret'
 from RootNode.java:129:in `interpret'
 from ASTInterpreter.java:120:in `INTERPRET_ROOT'
 from Ruby.java:797:in `runInterpreter'
 from Ruby.java:2576:in `loadFile'
 from ExternalScript.java:66:in `load'
 from LoadService.java:329:in `load'
 from RubyKernel.java:1053:in `loadCommon'
 from RubyKernel.java:1045:in `load19'
 from RubyKernel$INVOKER$s$0$1$load19_DBG.gen:-1:in `call'
 from DynamicMethod.java:208:in `call'
 from DynamicMethod.java:204:in `call'
 from CachingCallSite.java:326:in `cacheAndCall'
 from CachingCallSite.java:170:in `call'
 from FCallOneArgNode.java:36:in `interpret'
 from NewlineNode.java:105:in `interpret'
 from BlockNode.java:71:in `interpret'
 from RootNode.java:129:in `interpret'
 from ASTInterpreter.java:120:in `INTERPRET_ROOT'
 from Ruby.java:797:in `runInterpreter'
 from Ruby.java:805:in `runInterpreter'
 from Ruby.java:644:in `runNormally'
 from Ruby.java:489:in `runFromMain'
 from Main.java:375:in `doRunFromMain'
 from Main.java:264:in `internalRun'
 from Main.java:230:in `run'
 from Main.java:214:in `run'
 from Main.java:194:in `main'


0

Please sign in to leave a comment.