Please help me to setup debugger on RubyMine for Mac

Hi, I have been struggling to get debugging working on my mac with RubyMine.

OS: Mac Sierra
Ruby Mine: 2017.3.3
Sketchup 2017 Make 17.3.116

I have followed the instructions on the Debugger Github page and I have succeeded in getting the RubyMine debugger to the “connected” state. However, the debugger is not stopping at any of my breakpoints. I have tried in both my own project and in the much simpler “hello cube” example.

Has anybody else been able to get connected, but haven’t had the debugger stop at breakpoints?

I do see the same “Limited Debugging Info…” message that @jeroen reported.

Thanks,
-Steve

Can you show a screenshot of your debug config?

Also, where do you have your source files?

Thanks so much for the clue! RubyMine and Sketchup were using different source directories. I implemented your loader script from an earlier post in this topic and now my breakpoints are working.

1 Like

Just started playing with RubyMine on Mac and came across this interesting error in the file “debug-sketchup.rb”:
This script builds a line of text and tells the RubyMine terminal to execute it. The line of text, as it appears on my Mac (I’m using SketchUp 2022) is this:
open -a /Applications/SketchUp 2022/SketchUp.app -- args -rdebug "ide port=7000"
The problem is the space between ‘SketchUp’ and ‘2022’ has meaning that we do not want! Therefore, the space must be escaped with a backslash:
open -a /Applications/SketchUp\ 2022/SketchUp.app -- args -rdebug "ide port=7000"
Just to make it interesting, there’s a “raise” method that first checks for “SketchUp 2022” that needs that space with no backslash. So we have to add the backslash after the “raise.” And, of course, the backslash itself must also be escaped, so now my debug-sketchup.rb looks like this:

...
if RUBY_PLATFORM.include?('darwin')
  # OS X
  sketchup_path = "/Applications/SketchUp #{version}"
  sketchup = File.join(sketchup_path, 'SketchUp.app')
  raise "SketchUp #{version} not found." unless File.exist?(sketchup)
  sketchup.gsub!("p 20", "p\\\ 20")
  sketchup_command = %(open -a #{sketchup} --args #{debug_args})
else
  # Windows
...

In other words, I added a gsub! method on the string “sketchup” to add in the backslash. (And yes, you really do need all three backslashes!)
Now debug-sketchup.rb works correctly on my Mac.
I’m off to the races! :smiley:

Probably should be four (because there escaping happening two times)

No two.

"p\\\ 20" == "p\\ 20"
=> true

Three seems to work, so I use that. :slight_smile:

Three is exactly the same as two. See my post above. Four would likely not work.