Вопрос

I have RubyMine 4.5 (I also have Idea 12 with Ruby plugin), and Torquebox 2.3. It seems RubyMine doesn't have native support for Torquebox, as it has for Passenger, Trinidad, etc.

I can't figure out how I debug an application on Torquebox server with RubyMine. Any thoughts?

Also:

I tried RubyMine 5 EAP, and it seems it doesn't work out of the box.

I got the following error:

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

But the 'ruby-debug-ide' gem is installed.

Don't know is the problem in RubyMine or Torquebox.

Also: I was able to solve the previous problem by adding the following string to the Gemfile

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

And it seems that debugger attaches to Torquebox server process, but now when app reaches a breakpoint debugger process just silently dies:

Process finished with exit code 143

However Torquebox still works, but gives me a runtime error:

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

with the following stacktrace:

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'

Withal I got hundreds IDE errors related to jruby.

Edit:

After fixing Gemfile with appropriate versions of gems:

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

Debugger seemed to be working, but when I got an exception in my app, debugger crashed: process died, and I got the following:

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

I suppose I better wait for RubyMine 5 RC.

Это было полезно?

Решение

According to this comment it's already implemented and will be available in RubyMine 5.0 and next IDEA plug-in.

You can already try it in RubyMine 5.0 EAP.

Другие советы

Please check the name of your folder. The name of your project should be normal. Once I use "jim's project" under OSX system as the project folder name, the error above occurs. After changing to "jims project", everything is fine.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top