私は RubyMine 4.5 (Ruby プラグイン付きの Idea 12 も持っています) と Torquebox 2.3 を持っています。RubyMine は、Passenger、Trinidad などのように、Torquebox をネイティブでサポートしていないようです。
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 を待ったほうがいいと思います。