Getting rdebug-ide working with SU Ruby
-
I am on this quest to get Netbeans IDE working with SU Ruby. The development version of Netbeans has a capability to attach a debugger to a Ruby process. See link below:
http://blogs.sun.com/martink/entry/remote_debugging_debug_whatever_ruby
This works awesome on regular Ruby programs. So I thought I would muddle my way through trying to get it to work with SU Ruby. I have a regular ruby 1.8.6 install. Steps so far:
- Created init.rb and put it in plugins dir. This is a one line Ruby program to add a regular Ruby install paths to the SU loadpath.
$LOAD_PATH.concat([".","c:/ruby/lib/ruby/site_ruby/1.8","c:/ruby/lib/ruby/site_ruby/1.8/i386-msvcrt","c:/ruby/lib/ruby/site_ruby","c:/ruby/lib/ruby/1.8","c:/ruby/lib/ruby/1.8/i386-mswin32"])
-
Made sure I have the latest rubygems and rdebug-ide. Copied over the c:\ruby\bin\rdebug-ide to ..\plugins\debug\rdebug-ide.rb
-
Started SU Ruby console and did a require 'debug/rdebug-ide'. Got this error
require 'debug/rdebug-ide'
Error: #<NoMethodError: undefined methodsync=' for #<Sketchup::Console:0x342ed90>> (eval) C:/Program Files/Google/Google SketchUp 7/Plugins/debug/rdebug-ide.rb:19:in
load'
C:/Program Files/Google/Google SketchUp 7/Plugins/debug/rdebug-ide.rb:19
(eval):0:in `require'
(eval):0If I look at loadpath it seems to contain all the required paths. Any ideas on how to get this working.
$:
["C:/Program Files/Google/Google SketchUp 7/Plugins", "C:/Program Files/Google/Google SketchUp 7/Tools", ".", "c:/ruby/lib/ruby/gems/1.8/gems/linecache-0.43-x86-mswin32/bin", "c:/ruby/lib/ruby/gems/1.8/gems/linecache-0.43-x86-mswin32/lib", "c:/ruby/lib/ruby/gems/1.8/gems/ruby-debug-base-0.10.3-x86-mswin32/bin", "c:/ruby/lib/ruby/gems/1.8/gems/ruby-debug-base-0.10.3-x86-mswin32/lib", "c:/ruby/lib/ruby/gems/1.8/gems/ruby-debug-ide-0.4.5/bin", "c:/ruby/lib/ruby/gems/1.8/gems/ruby-debug-ide-0.4.5/lib", "c:/ruby/lib/ruby/site_ruby/1.8", "c:/ruby/lib/ruby/site_ruby/1.8/i386-msvcrt", "c:/ruby/lib/ruby/site_ruby", "c:/ruby/lib/ruby/1.8", "c:/ruby/lib/ruby/1.8/i386-mswin32"] -
@billbell52 said:
I am on this quest to get Netbeans IDE working with SU Ruby. The development version of Netbeans has a capability to attach a debugger to a Ruby process.
...From a quick reading, it looks like this is an ide to attach to a Ruby script run from the command line.
SketchUp, however, runs scripts from an embedded version of Ruby. Not the command line. So there's no port or process to attach to.
Secondly, running the rudebug-ide would not give you access to the SketchUp Ruby extensions embedded inside SketchUp. Eg., If you issue a UI.messagebox() call (or any SketchUp call) from your script loaded by rdebug-ide, it'll just get an "unknown method" error.
Third, the SketchUp Console is in control of all Standard in, out, and err I/O streams. Ruby-ide will have to redirect the SketchUp Console I/O to itself, then restore them when it's finished.
For MS windows, an alternative might be:
http://www.sketchucation.com/forums/scf/viewtopic.php?f=180&t=18130
SketchUcation Community Forums • View topic - [plugin] SuRDebug
Advertisement