Nothing happened when I try to debug in Sketchup by Rubymine

Hello everyone. I’m new to sketchup plugins.
And I recently try to establish Rubymine debugging environment with this tutorial.

However, after I thought that I finished the setup.
Sketchup did open after I click debugging button.
But I can’t see the example plugin “testup” anywhere.
Isn’t this plugin should showup and allows me to operate so that I can debug?


Also i got this warning every time I start debugging.
image
Did miss something?
I don’t know what exactly can this “Debug in Sketchup” do.
Cause I already can debug in Rubymine because of that tutorial now.

You also need to install and connect to the debugger DLL. You’ll have to download the debugger DLL file and manually copy it into SketchUp’s program folder, and then start SketchUp with a debug command line. (You can setup a special shortcut icon just for debugging.)
See:
RubyMine Debugger Setup · SketchUp/sketchup-ruby-api-tutorials Wiki · GitHub

I would suggest that you first play with debugging one of the simple examples provided in the tutorials repository.


The reason you don’t see TestUp is … because it is not part of the tutorial nor debugger. It is a complex extension to run Test Units on the extensions (plugins) that you may write yourself. It uses the standard Minitest Ruby gem.

It will require that you also have NodeJS and the the Minitest gem installed.
See the TesUp README.

No, you do not need TestUp to debug other extensions.

Did you add SketchUp’s "Tools" folder to the Load Paths ?
If not see …
RubyMine Project Setup · SketchUp/sketchup-ruby-api-tutorials Wiki · GitHub

Hello DanRathbun. I appreciate your reply.

I think i did put SURubyDebugger.dll and SURubyDebugger.dylib into my Sketchup folder.
C:\Program Files\SketchUp\SketchUp 2018
But what do you mean “install and connect”?
image

Yes I was think of debugging with some small plugin that I wrote. But I’m just trying to setup a debugging environment now.
And the tutorial is using this “testup” plugin. So I follow the tutorial step by step to see whether I can make debug function properly.
Cause there’s so many file in “Testup” plugin. It’s really complex for me.
I don’t know what file is necessary and what can be delete.
So i thought that I’ll try to debug my own plugin after I’m familiar with debug workflow.

If I want to debug my own plugin. I only need to change “testup.rb” and “testup” in “src” to my own plugin file right?

Yes i know that I don’t need TestUp.
It’s just a example plugin to show us the workflow of debugging a plugin in Sketchup.
I mean If it function properly. Can I see the plugin that i’m debugging in Sketchup? And I can use that plugin right?
Actually I totally don’t know what exactly “Debug in Sketchup” works.
But i assumed that shouldn’t be a empty Sketchup window without the plugin that is being debugging.

Yes I did add that folder to Load Paths.
It’s this one right?

Also when I try to debug a simple plugin “ex_custom_tool”.
I got a warning.
I just replace testup with ex_custom_tool and testup.rb with ex_custom_tool.rb

But I the code, it seems like rubymine can recognize sketchup.rb.
what is going on?
image

Install = manually copy the DLL file.
(Delete the DYLIB it is a Mac platform library not for Windows platform.)

Connect = Start the SketchUp.exe with a debug switch and port parameter as explained in the linked page. Then open your project in RubyMine.

TestUp is too complex for newbs. Again use one of the simple example extensions.

No you set up a new project as explained but point to your own projects “src” folder instead of the TestUp project’s “src” folder.

You can “see” it if it makes itself known usually via menu item commands or toolbar buttons.
The menu commands can be either menu items in the main menubar or conditional commands that appear in the right-click context menu. (How these things are done are covered in other forum topics. Use the magnifying glass icon to search [top right].)

If it does not have any LoadError(s) or SyntaxError(s) it might be usable.
This is what testing and debugging is for, to find RuntimeError(s).

A forum post is not a good place to teach program debugging.
I’m sure that there are better documents and tutorials out on the internet.

In fact, the basics of programming in any language is a prerequisite to learning how to debug.

This assumption is incorrect. SketchUp extensions are event driven code. It is the user’s actions that trigger events which an extension responds to.

The simplest user events (as already said) are clicks on UI elements like menu items or toolbar buttons.

  • UI module

More complex events would be importing geometry from an external file or exporting to an eternal foreign file format of some kind other than .skp.

The most complex events are reacting to the modification of model objects such as it’s various collections, most often it’s Entities collection, using observers.

Regardless, in order for an extension to do anything within SketchUp, it must be loaded into SketchUp’s Ruby process. There are two ways. Automatic, if it is a proper extension accessible to SketchUp. (Either installed into the user “Plugins” folder or loaded via a “pointer script” in the “Plugins” folder that adds a special project repository path to Ruby’s $LOAD_PATH array and instructs SketchUp to load the project.)
See: SketchupExtension class
The second way is a manual load from the Ruby Console command line using Ruby’s global load() method.
See: Kernel.load
It is easiest to catch and fix LoadErrors and Syntax errors using a manual load from the console.

Once these are fixed, you would use the debugger to find and fix any RuntimeError.

The path is correct if you have SketchUp 2018 installed.

Did you add content roots ? per …
RubyMine Project Setup · SketchUp/sketchup-ruby-api-tutorials Wiki · GitHub

I am not a RubyMine user myself, so I can’t really help when it doesn’t work correctly.

I would say concentrate on learning the basics of Ruby programming first and then later more complex things like debugging.

1 Like

@jack233924 I need to to understand that TestUp does not do anything automatically.
The user (who is a programmer) opens a dialog box that lists various Ruby tests to perform on an extension. The programmer needs to check boxes and then initiate the testing.

1 Like