我有一个在Puma Web服务器上运行的Ruby On Rails(JRuby)项目,该项目在本地Docker容器中运行。我尝试使用Ruby Remote配置从同一主机上运行的IntelliJ调试应用程序。
在我的应用程序Gems之外,我已将以下内容添加到测试/开发组:
gem 'ruby-debug-base'
gem 'ruby-debug-ide'
当我通过启动脚本在Docker容器中运行命令时,我正在使用此命令:
exec bundle exec rdebug-ide --host 0.0.0.0 --port 1234 --dispatcher-port 26162 -- /usr/local/bundle/gems/puma-3.5.2-java/bin/puma -C /var/www/apps/app1/config/puma.rb
当我启动容器时,我得到以下输出,似乎调试器正确启动:
Fast Debugger (ruby-debug-ide 0.6.0, ruby-debug-base 0.10.3.2, file filtering is not supported) listens on 0.0.0.0:1234
当我在IntelliJ中运行远程调试时,它似乎在那时启动了Puma,然后它失败了似乎是冲突或调用listen
gem(我使用listen& #39;〜> 3.1.5')。我看到这个输出,因为它似乎不支持该事件。
Puma starting in single mode...
* Version 3.5.2 (jruby 9.1.2.0 - ruby 2.3.0), codename: Amateur Raccoon Rocketry
* Min threads: 0, max threads: 16
* Environment: development
Exception in thread "Ruby-0-Thread-2: /usr/local/bundle/gems/listen-3.1.5/lib/listen/internals/thread_pool.rb:6" java.lang.IllegalArgumentException: unknown event type: thread-begin
at org.jruby.debug.Util.typeForEvent(Util.java:122)
at org.jruby.debug.DebugEventHook.eventHandler(DebugEventHook.java:97)
at org.jruby.runtime.EventHook.event(EventHook.java:30)
at org.jruby.Ruby.callEventHooks(Ruby.java:3231)
at org.jruby.runtime.ThreadContext.trace(ThreadContext.java:641)
at org.jruby.internal.runtime.RubyRunnable.run(RubyRunnable.java:103)
at java.lang.Thread.run(Thread.java:745)
Exception in thread "Ruby-0-Thread-3: /usr/local/bundle/gems/listen-3.1.5/lib/listen/internals/thread_pool.rb:6" java.lang.IllegalArgumentException: unknown event type: thread-begin
at org.jruby.debug.Util.typeForEvent(Util.java:122)
at org.jruby.debug.DebugEventHook.eventHandler(DebugEventHook.java:97)
at org.jruby.runtime.EventHook.event(EventHook.java:30)
at org.jruby.Ruby.callEventHooks(Ruby.java:3231)
at org.jruby.runtime.ThreadContext.trace(ThreadContext.java:641)
at org.jruby.internal.runtime.RubyRunnable.run(RubyRunnable.java:103)
at java.lang.Thread.run(Thread.java:745)
! Unable to load application: Timeout::Error: execution expired
Timeout::Error: execution expired
我尝试了不同的版本,无论我尝试什么,我似乎都得到同样的东西。 Ruby远程调试是否存在限制,这与listen
gem不兼容?
我使用的是Puma 3.5.2(平台:jruby),Listen 3.1.5,Ruby 2.3.1p112,JRuby 9.1.2.0和Ruby 2.3.0。我也在运行Linux Mint的VirtualBox VM上运行,如果这有任何区别的话。我对来自Java背景的Ruby on Rails相对较新,所以这可能是我所缺少的新手。