Getting rdebug-ide working with SU Ruby

Getting rdebug-ide working with SU Ruby

Postby billbell52 » Sat May 02, 2009 8:31 pm

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/remo ... tever_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:

1. 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"])

2. Made sure I have the latest rubygems and rdebug-ide. Copied over the c:\ruby\bin\rdebug-ide to ..\plugins\debug\rdebug-ide.rb

3. Started SU Ruby console and did a require 'debug/rdebug-ide'. Got this error

require 'debug/rdebug-ide'
Error: #<NoMethodError: undefined method `sync=' 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):0

If 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"]
0

billbell52 
 

Re: Getting rdebug-ide working with SU Ruby

Postby pecan » Sun May 03, 2009 8:35 pm

billbell52 wrote: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:

viewtopic.php?f=180&t=18130
SketchUcation Community Forums • View topic - [plugin] SuRDebug
0

pecan 
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 



 

Return to Developers' Forum

Who is online

Users browsing this forum: Bing [Bot] and 5 guests

Visit our sponsors: