1

我有 RubyMine 4.5(我也有带有 Ruby 插件的 Idea 12)和 Torquebox 2.3。RubyMine 似乎没有对 Torquebox 的原生支持,就像它对Passenger、Trinidad 等一样。

我不知道如何使用 RubyMine 在 Torquebox 服务器上调试应用程序。有什么想法吗?

还:

我尝试了 RubyMine 5 EAP,但它似乎不能开箱即用。

我收到以下错误:

exception:
javax.servlet.ServletException: org.jruby.exceptions.RaiseException: (LoadError) no such file to load -- ruby/debug/ide

root cause:
org.jruby.exceptions.RaiseException: (LoadError) no such file to load -- ruby/debug/ide

但是安装了“ruby-debug-ide”gem。

不知道是 RubyMine 还是 Torquebox 的问题。

另外: 我能够通过将以下字符串添加到 Gemfile 来解决前面的问题

gem 'ruby-debug-base'
gem 'ruby-debug-ide'

似乎调试器附加到了 Torquebox 服务器进程,但是现在当应用程序到达断点时,调试器进程就会默默地死掉:

Process finished with exit code 143

然而 Torquebox 仍然有效,但给了我一个运行时错误:

@last_breakpoint supposed to be nil. is #<Debugger::Breakpoint:0x1adad4f>

使用以下堆栈跟踪:

ruby-debug-ide (0.4.17.beta16) lib/ruby-debug-ide/event_processor.rb:18:in `at_breakpoint'
ruby-debug-base-0.10.4 (java) lib/ruby-debug-base.rb:43:in `at_breakpoint'
app/controllers/orders_controller.rb:5:in `index'
org/jruby/RubyBasicObject.java:1659:in `__send__'
org/jruby/RubyKernel.java:2086:in `send'
actionpack (3.2.11) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
actionpack (3.2.11) lib/abstract_controller/base.rb:167:in `process_action'
actionpack (3.2.11) lib/action_controller/metal/rendering.rb:10:in `process_action'
actionpack (3.2.11) lib/abstract_controller/callbacks.rb:18:in `process_action'
activesupport (3.2.11) lib/active_support/callbacks.rb:417:in `_run__837017838__process_action__370397448__callbacks'
org/jruby/RubyBasicObject.java:1659:in `__send__'
org/jruby/RubyKernel.java:2086:in `send'
activesupport (3.2.11) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.11) lib/active_support/callbacks.rb:390:in `_run_process_action_callbacks'
org/jruby/RubyBasicObject.java:1665:in `__send__'
org/jruby/RubyKernel.java:2090:in `send'
activesupport (3.2.11) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.2.11) lib/abstract_controller/callbacks.rb:17:in `process_action'
actionpack (3.2.11) lib/action_controller/metal/rescue.rb:29:in `process_action'
actionpack (3.2.11) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
activesupport (3.2.11) lib/active_support/notifications.rb:123:in `instrument'
activesupport (3.2.11) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (3.2.11) lib/active_support/notifications.rb:123:in `instrument'
actionpack (3.2.11) lib/action_controller/metal/instrumentation.rb:29:in `process_action'
actionpack (3.2.11) lib/action_controller/metal/params_wrapper.rb:207:in `process_action'
activerecord (3.2.11) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (3.2.11) lib/abstract_controller/base.rb:121:in `process'
actionpack (3.2.11) lib/abstract_controller/rendering.rb:45:in `process'
actionpack (3.2.11) lib/action_controller/metal.rb:203:in `dispatch'
actionpack (3.2.11) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
actionpack (3.2.11) lib/action_controller/metal.rb:246:in `action'
org/jruby/RubyProc.java:261:in `call'
org/jruby/RubyProc.java:249:in `call'
actionpack (3.2.11) lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
actionpack (3.2.11) lib/action_dispatch/routing/route_set.rb:36:in `call'
journey (1.0.4) lib/journey/router.rb:68:in `call'
org/jruby/RubyArray.java:1613:in `each'
journey (1.0.4) lib/journey/router.rb:56:in `call'
actionpack (3.2.11) lib/action_dispatch/routing/route_set.rb:601:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
rack (1.4.4) lib/rack/etag.rb:23:in `call'
rack (1.4.4) lib/rack/conditionalget.rb:25:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/head.rb:14:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/flash.rb:242:in `call'
torquebox-web-2.3.0 (java) lib/torquebox/session/servlet_store.rb:31:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/cookies.rb:341:in `call'
activerecord (3.2.11) lib/active_record/query_cache.rb:64:in `call'
activerecord (3.2.11) lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/callbacks.rb:28:in `call'
activesupport (3.2.11) lib/active_support/callbacks.rb:408:in `_run__521886712__call__4409452__callbacks'
org/jruby/RubyBasicObject.java:1659:in `__send__'
org/jruby/RubyKernel.java:2086:in `send'
activesupport (3.2.11) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.11) lib/active_support/callbacks.rb:390:in `_run_call_callbacks'
org/jruby/RubyBasicObject.java:1659:in `__send__'
org/jruby/RubyKernel.java:2086:in `send'
activesupport (3.2.11) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.2.11) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/reloader.rb:65:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
railties (3.2.11) lib/rails/rack/logger.rb:32:in `call_app'
railties (3.2.11) lib/rails/rack/logger.rb:16:in `call'
activesupport (3.2.11) lib/active_support/tagged_logging.rb:22:in `tagged'
railties (3.2.11) lib/rails/rack/logger.rb:16:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/request_id.rb:22:in `call'
rack (1.4.4) lib/rack/methodoverride.rb:21:in `call'
rack (1.4.4) lib/rack/runtime.rb:17:in `call'
rack (1.4.4) lib/rack/lock.rb:15:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/static.rb:62:in `call'
railties (3.2.11) lib/rails/engine.rb:479:in `call'
railties (3.2.11) lib/rails/application.rb:223:in `call'
org/jruby/RubyBasicObject.java:1665:in `__send__'
org/jruby/RubyKernel.java:2090:in `send'
railties (3.2.11) lib/rails/railtie/configurable.rb:30:in `method_missing'

我得到了数百个与 jruby 相关的 IDE 错误。

编辑:

使用适当版本的 gem 修复 Gemfile 后:

gem 'ruby-debug-base', '>= 0.10.5.rc3'
gem 'ruby-debug-ide', '>= 0.4.17.beta14'

调试器似乎正在工作,但是当我的应用程序出现异常时,调试器崩溃:进程死亡,我得到以下信息:

@last_breakpoint supposed to be nil. is #<Debugger::Breakpoint:0x1d91ad6>

我想我最好等待 RubyMine 5 RC。

4

2 回答 2

1

根据这个评论,它已经实现并且将在 RubyMine 5.0 和下一个 IDEA 插件中可用。

您已经可以在RubyMine 5.0 EAP中试用它。

于 2013-02-02T15:35:58.853 回答
0

请检查您的文件夹名称。你的项目名称应该是正常的。一旦我在OSX系统下使用“jim的项目”作为项目文件夹名称,就会出现上述错误。改成“jims project”后,一切正常。

于 2014-11-21T17:13:35.683 回答