如何使用Eclipse调试jRuby?

伊琳娜·拉波特(Irina Rapoport)

这听起来像是一个相当琐碎的问题,但是多年来,我一直在为之苦苦挣扎,放弃了Ruby并回到了这个问题上。我是一名尝试学习Ruby的Java / Eclipse人员,因此我想在Win 7、64位计算机上使用某些Eclipse插件调试jRuby / Rails 怎么这么难?我找不到分步说明(例如,安装此插件,此版本的jRuby,安装这些gems,调整这些设置)。在没有这种情况的情况下,我会碰碰运气,而我所做的一切似乎都会导致奇怪的错误。

此时,我正在尝试使用EasyEclipse(这是一个不错的选择吗?)。我发现默认安装(进入“程序文件”)不是一个好主意,而是将其安装在没有空格的路径上。与jRuby相同。我安装了两个调试gem(从我的头开始,是gem install ruby​​-debuggem install ruby​​-debug-ide),然后进行了“ gem更新”。我正在运行EasyEclipse和jRuby的最新稳定版本。

我能够运行Ruby程序。但是,当我放置一个断点并尝试调试时,调试器陷入“启动(95%)”状态,并且控制台显示:

ruby 1.9.3调试器在端口52188上侦听Thread:Class的未定义方法'critical ='

那就是,当我在首选项中打开“ Use ruby​​-debug library”库时,我得到了:

   Fast Debugger (ruby-debug-ide 0.4.18, ruby-debug-base 0.10.3.2) listens on 127.0.0.1:52819
Hello, world!
Hello, world!2
Hello, world!3
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:347: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:74:in `INTERPRET_METHOD'
    from InterpretedMethod.java:139:in `call'
    from CachingCallSite.java:306:in `cacheAndCall'
    from CachingCallSite.java:136:in `call'
    from CallNoArgNode.java:60: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:206:in `evalBlockBody'
    from Interpreted19Block.java:157:in `yield'
    from Block.java:142:in `yield'
    from RubyArray.java:1610:in `eachCommon'
    from RubyArray.java:1617: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:206:in `evalBlockBody'
    from Interpreted19Block.java:157:in `yield'
    from Block.java:142:in `yield'
    from RubyContinuation.java:107:in `enter'
    from RubyKernel.java:1261:in `rbCatch19Common'
    from RubyKernel.java:1254: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:222:in `executeBody'
    from RescueNode.java:117:in `interpret'
    from ASTInterpreter.java:74:in `INTERPRET_METHOD'
    from InterpretedMethod.java:139:in `call'
    from CachingCallSite.java:306:in `cacheAndCall'
    from CachingCallSite.java:136:in `call'
    from CallNoArgNode.java:60:in `interpret'
    from NewlineNode.java:105:in `interpret'
    from BlockNode.java:71:in `interpret'
    from ASTInterpreter.java:74: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:74: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:74:in `INTERPRET_METHOD'
    from InterpretedMethod.java:112:in `call'
    from InterpretedMethod.java:126:in `call'
    from RubyClass.java:722:in `finvoke'
    from Helpers.java:486:in `invoke'
    from RubyBasicObject.java:367: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:2882:in `callEventHooks'
    from ASTInterpreter.java:239:in `callTraceFunction'
    from NewlineNode.java:101:in `interpret'
    from BlockNode.java:71:in `interpret'
    from ASTInterpreter.java:103:in `INTERPRET_CLASS'
    from ASTInterpreter.java:280:in `evalClassDefinitionBody'
    from ClassNode.java:138:in `interpret'
    from NewlineNode.java:105:in `interpret'
    from RootNode.java:129:in `interpret'
    from ASTInterpreter.java:121:in `INTERPRET_ROOT'
    from Ruby.java:834:in `runInterpreter'
    from Ruby.java:2674:in `loadFile'
    from ExternalScript.java:66:in `load'
    from LoadService.java:359: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:225:in `call'
    from DynamicMethod.java:221: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:74: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:121:in `INTERPRET_ROOT'
    from Ruby.java:834:in `runInterpreter'
    from Ruby.java:2674:in `loadFile'
    from ExternalScript.java:66:in `load'
    from LoadService.java:359:in `load'
    from RubyKernel.java:1081:in `loadCommon'
    from RubyKernel.java:1073:in `load19'
    from RubyKernel$INVOKER$s$0$1$load19_DBG.gen:-1:in `call'
    from DynamicMethod.java:209:in `call'
    from DynamicMethod.java:205: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:121:in `INTERPRET_ROOT'
    from Ruby.java:834:in `runInterpreter'
    from Ruby.java:842:in `runInterpreter'
    from Ruby.java:673:in `runNormally'
    from Ruby.java:518:in `runFromMain'
    from Main.java:390:in `doRunFromMain'
    from Main.java:279:in `internalRun'
    from Main.java:221:in `run'
    from Main.java:201:in `main'

这是怎么回事?

我想我可以继续使用Google进行搜索,并尝试在黑暗中找到自己的路,但是我已经花了很多时间这样做,而且肯定有人在我之前完成了在Eclipse中调试jRuby的琐碎任务吗?帮助!

rupweb

下载Eclipse动态语言工具箱-Ruby开发工具。导入您的ruby on rails项目。检查您的Gemfile引用:

gem 'ruby-debug'

然后转到Windows->首选项,并执行以下两项操作:

  • 将Eclipse红宝石解释器设置为:c:\ jruby \ bin \ jruby.bat

JRuby月食

  • 设置eclipse ruby​​调试引擎,因此它不是“快速调试器”,而是“ ruby​​内置调试器”

在此处输入图片说明

然后,在运行配置的主选项卡中,“ ruby​​脚本”下的启动脚本为bin/rails,并在“参数”选项卡中server --debugger解释器选项卡应指向JRuby.bat

运行->运行,并给它大约30秒钟的时间来加载JVM,ruby环境并挂接所有内容。然后检查您的 http://localhost:3000/

要开始执行调试,然后键入要启动调试debugger器的位置。

一切开始都是这样的:

Eclipse Ruby调试器

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

如何使用Eclipse调试UIAutomator脚本

来自分类Dev

如何使用Eclipse调试或运行pytest脚本?

来自分类Dev

如何调试需要输入的源代码(使用Eclipse)

来自分类Dev

设备重启后如何使用eclipse调试告警程序

来自分类Dev

如何使用jruby使用类声明

来自分类Dev

如何在Eclipse中调试Node.js程序(使用node-eclipse)?

来自分类Dev

调试时如何禁用Eclipse切换到调试视图

来自分类Dev

为什么eclipse调试器使用localhost进行调试?

来自分类Dev

无法使用Eclipse调试器进行调试

来自分类Dev

为什么Eclipse调试器使用localhost进行调试?

来自分类Dev

如何在Eclipse中调试Camunda webapp?

来自分类Dev

如何在Eclipse中调试Mojarra 2.2.9

来自分类Dev

如何让eclipse识别我的设备进行调试?

来自分类Dev

如何在Eclipse中调试外部插件?

来自分类Dev

如何配置ColdFusion Eclipse调试器

来自分类Dev

如何使用Eclipse在调试模式下运行Dropwizard应用程序?

来自分类Dev

如何使用Eclipse调试器查看集合内的对象类型?

来自分类Dev

如何使用Java项目在Eclipse中调试本机JNI C ++代码

来自分类Dev

如何使用eclipse在tomcat中部署多次战争,然后能够调试代码

来自分类Dev

如何使用直接运行器在 Eclipse 中调试 Dataflow/Apache Beam 管道 DoFn 功能

来自分类Dev

使用Eclipse和JBoss调试JSP

来自分类Dev

使用Eclipse调试本地Maven依赖项

来自分类Dev

在Eclipse中使用PyDev进行缓慢的调试

来自分类Dev

使用 Eclipse 运行/调试 Apache Fineract??

来自分类Dev

如何使用JRuby在Java中创建Ruby模块?

来自分类Dev

如何从Java中以编程方式使用jruby-complete?

来自分类Dev

如何使用节点的调试模块?

来自分类Dev

如何使用此调试宏?

来自分类Dev

如何使用Clion调试occi?

Related 相关文章

  1. 1

    如何使用Eclipse调试UIAutomator脚本

  2. 2

    如何使用Eclipse调试或运行pytest脚本?

  3. 3

    如何调试需要输入的源代码(使用Eclipse)

  4. 4

    设备重启后如何使用eclipse调试告警程序

  5. 5

    如何使用jruby使用类声明

  6. 6

    如何在Eclipse中调试Node.js程序(使用node-eclipse)?

  7. 7

    调试时如何禁用Eclipse切换到调试视图

  8. 8

    为什么eclipse调试器使用localhost进行调试?

  9. 9

    无法使用Eclipse调试器进行调试

  10. 10

    为什么Eclipse调试器使用localhost进行调试?

  11. 11

    如何在Eclipse中调试Camunda webapp?

  12. 12

    如何在Eclipse中调试Mojarra 2.2.9

  13. 13

    如何让eclipse识别我的设备进行调试?

  14. 14

    如何在Eclipse中调试外部插件?

  15. 15

    如何配置ColdFusion Eclipse调试器

  16. 16

    如何使用Eclipse在调试模式下运行Dropwizard应用程序?

  17. 17

    如何使用Eclipse调试器查看集合内的对象类型?

  18. 18

    如何使用Java项目在Eclipse中调试本机JNI C ++代码

  19. 19

    如何使用eclipse在tomcat中部署多次战争,然后能够调试代码

  20. 20

    如何使用直接运行器在 Eclipse 中调试 Dataflow/Apache Beam 管道 DoFn 功能

  21. 21

    使用Eclipse和JBoss调试JSP

  22. 22

    使用Eclipse调试本地Maven依赖项

  23. 23

    在Eclipse中使用PyDev进行缓慢的调试

  24. 24

    使用 Eclipse 运行/调试 Apache Fineract??

  25. 25

    如何使用JRuby在Java中创建Ruby模块?

  26. 26

    如何从Java中以编程方式使用jruby-complete?

  27. 27

    如何使用节点的调试模块?

  28. 28

    如何使用此调试宏?

  29. 29

    如何使用Clion调试occi?

热门标签

归档