Debugging with 2.6.8

Hallo

I have two portable Ruby versions:

- ruby 2.6.8p205 (2021-07-07 revision 67951) [x64-mingw32]

- ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x64-mingw32]

Now the "fun" starts. :-)

The debugger works in 3.0.2:

C:\PortableApps\Ruby\Ruby30\bin\ruby.exe C:\PortableApps\Ruby\Ruby30\lib\ruby\gems\3.0.0\gems\ruby-debug-ide-0.7.3\bin\rdebug-ide --key-value --disable-int-handler --evaluation-timeout 10 --evaluation-control --time-limit 100 --memory-limit 0 --rubymine-protocol-extensions --port 58233 --host 0.0.0.0 --dispatcher-port 58234 -- d:/Programmierung/Ruby/MultipleConstructor/main.rb

Fast Debugger (ruby-debug-ide 0.7.3, debase 0.2.5.beta2, file filtering is supported) listens on 0.0.0.0:58233

In version 2.6.8 it does not work:

C:\PortableApps\Ruby\Ruby26\bin\ruby.exe C:\PortableApps\Ruby\Ruby26\lib\ruby\gems\2.6.0\gems\ruby-debug-ide-2.3.1\bin\rdebug-ide --key-value --step-over-in-blocks --disable-int-handler --evaluation-timeout 10 --evaluation-control --time-limit 100 --memory-limit 0 --rubymine-protocol-extensions --port 58464 --host 0.0.0.0 --dispatcher-port 58465 -- d:/Programmierung/Ruby/MultipleConstructor/main.rb

Fast Debugger (ruby-debug-ide 2.3.1, debase 2.3.2, file filtering is supported, block breakpoints supported, smart steps supported, obtaining return values supported, partial obtaining of instance variables supported) listens on 0.0.0.0:58464

I figured out, that different versions of `ruby-debug-ide` and `debase` were installed. I deinstalled the versions

ruby-debug-ide 2.3.1, debase 2.3.2

in terminal and installed the same versions as I have in 3.0.2:

ruby-debug-ide 0.7.3, debase 0.2.5.beta2

Starting the debugger again, Rubymine claimed that no debugger was installed and after confirming to install the gems for me, again the above-mentioned versions (ruby-debug-ide 2.3.1, debase 2.3.2) were installed and the debugging process does not work. I'm also wondering why `ruby-debug-ide 2.3.1` was installed, because on rubygems.org the latest version is 0.7.3.

0
9 comments

Hallo Pere,

Versions differ because ruby-debug-ide 2.3.1 and debase 2.3.2 are of so called experimental debugger and they aren't available for Ruby 3.0 (https://youtrack.jetbrains.com/issue/RUBY-27310). If you want to use ruby-debug-ide 0.7.3 and debase 0.2.5.beta2 for all your Rubies then you need to uncheck 'ruby.use.experimental.debugger' key in Help - Find Action - Registry.

Still could you please specify what exactly didn't go well on Ruby 2.6.8 (from the code snippet I can see that the debugger has been started)

0

Hi Olga,

 

Thanks for the quick answer and the hint with 'ruby.use.experimental.debugger'. After I unchecked this setting, the debugger works as expected with Ruby 2.6.8.

Since I did not know this setting before, and thus had not changed it consciously or unconsciously, I assume that it is set by default. Maybe it makes more sense not to set such default values.

>> Still could you please specify what exactly didn't go well on Ruby 2.6.8 (from the code snippet I can see that the debugger has been started)

Yes, the debugger started, but the code didn't stop at a breakpoint. Sorry for not being clear on this point in my initial posting.

0

Could you please provide more details about the project in question? Is it possible to share a minimal sample for reproduce (because in general it should work). Does it stop at the breakpoints in a plain Ruby project with some simple scripts?

0

Here a minimal working example:

a = 1
b = 2 # <-- Breakpoint
c = 3
p

The script does not stop at the breakpoint, instead it runsthrough to the end. Here the ouput of thge terminal:

C:\PortableApps\Ruby\Ruby26\bin\ruby.exe C:\Users\ped\.local\share\gem\ruby\2.6.0\gems\ruby-debug-ide-2.3.3\bin\rdebug-ide --key-value --step-over-in-blocks --disable-int-handler --evaluation-timeout 10 --evaluation-control --time-limit 100 --memory-limit 0 --rubymine-protocol-extensions --port 59208 --host 0.0.0.0 --dispatcher-port 59209 -- Z:/test/test.rb
Fast Debugger (ruby-debug-ide 2.3.3, debase 2.3.2, file filtering is supported, block breakpoints supported, smart steps supported, obtaining return values supported, partial obtaining of instance variables supported) listens on 0.0.0.0:59208
3

Process finished with exit code 0

I figured out, that the gems (`ruby-debug-ide` and `debase`) are not installed in the folder of my portable ruby installation `c:\PortableApps\Ruby\Ruby26\lib\ruby\gems\2.6.0\gems\`, instead a new folder (.local) has been created by Rubymine in my users home directory and the gems are installed in `c:\Users\ped\.local\share\gem\ruby\2.6.0\gems\`. Rubymine even does not care, if the gems are installed in "standard gems directory" of my portable ruby "installation". It always creates the ".local" directory and installs the gems there.  I'm not sure if I understand the concept very well and this has something to do with my previous problem. But unchecking `ruby.use.experimental.debugger` solves the problem for me.

You wrote "because in general it should work". Generally it perhaps should. :-) But at the end nothing is as honest as the reality. And the reality does not care about what "generally should". :-)

Thank you very much for your time. I very much appreciate that the JetBrains-team takes care of even such seemingly small difficulties promptly and is helpful. This is by far not a matter of course, so that it is easy for me as a "hobby programmer" to prefer products from JetBrains over other competitors.

0

Which RubyMine version do you use? I've tried it in 2021.3 but it stopped as expected.

As for the gems installation, if the Ruby SDK is a system one then we install gems with `--user-install`. Then it depends on rubygems, which path will be used in case of such an option.

0

Has also been forced to disable using experimental debugger - failing instead of stopping at breakpoints:

36288: <frame no="20" file="/Users/thunder/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/minitest-5.15.0/lib/minitest.rb" label="__run" line="169" />
36288: <frame no="21" file="/Users/thunder/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/minitest-5.15.0/lib/minitest.rb" label="run" line="146" />
36288: <frame no="22" file="/Users/thunder/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/minitest-5.15.0/lib/minitest.rb" label="autorun" line="73" />
36288: </frames>
36288: Done executing command: ["where", "backtrace"]
36288: INTERNAL ERROR!!! Connection reset by peer @ io_fillbuf - fd:10

36288: <error>
36288: <error>
36288: <error>
36288: <error>
36288: Resumed Thread #<Thread:0x00007fd8a685fa58 run>

Process finished with exit code 143 (interrupted by signal 15: SIGTERM)

Build #RM-213.6461.75, built on December 28, 2021
Runtime version: 11.0.13+7-b1751.21 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
MacOS 11.6.2


0

Aurel Branzeanu, would it be possible to provide a minimal project/code sample for reproduce?

0

Olga Kuvardina, unfortunately, no. It is a big project, also under NDA. And it is not always failing. In most cases, the breakpoints are working OK, but I've stumbled upon a test suite that won't go at all, and I was forced to use the older debug gems to be able to investigate the code workflow.

0

Aurel Branzeanu, if you find any steps for stable reproduce please let us know because it'll help us to investigate it better.

0

Please sign in to leave a comment.