• Login
sketchucation logo sketchucation
  • Login
ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

Getting rdebug-ide working with SU Ruby

Scheduled Pinned Locked Moved Developers' Forum
2 Posts 2 Posters 951 Views 2 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    billbell52
    last edited by 2 May 2009, 19:31

    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:

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

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

    2. 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"]

    1 Reply Last reply Reply Quote 0
    • P Offline
      pecan
      last edited by 3 May 2009, 19:35

      @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

      1 Reply Last reply Reply Quote 0
      • 1 / 1
      1 / 1
      • First post
        1/2
        Last post
      Buy SketchPlus
      Buy SUbD
      Buy WrapR
      Buy eBook
      Buy Modelur
      Buy Vertex Tools
      Buy SketchCuisine
      Buy FormFonts

      Advertisement