6 messages in com.googlegroups.sketchuprubyrequired modules not loading| From | Sent On | Attachments |
|---|---|---|
| Justin G | 25 Mar 2008 13:08 | |
| Todd Burch - Katy, Texas | 25 Mar 2008 15:05 | |
| Justin G | 26 Mar 2008 07:14 | |
| Justin G | 26 Mar 2008 08:45 | |
| Todd Burch - Katy, Texas | 26 Mar 2008 08:56 | |
| Todd Burch - Katy, Texas | 26 Mar 2008 09:01 |
| Subject: | required modules not loading![]() |
|---|---|
| From: | Justin G (lase...@gmail.com) |
| Date: | 03/25/2008 01:08:03 PM |
| List: | com.googlegroups.sketchupruby |
I'm trying to create a script that reads an XML file and then generates geometry from that. The problem that I keep running into is that the "require" statement does not work from within Sketchup. It works fine when run from Ruby outside of Sketchup.
I first tried: require "rexml/document" which didn't work.
So I tried the absolute path: require "C:\\ruby\\lib\\ruby\\1.8\\rexml\\document" This loaded that file, but none of the files referenced by "require" statements inside document.rb would load.
I did some digging and found this function for Sketchup: require_all "C:\\ruby\\lib\\ruby\\1.8\\rexml\\" which purports to load every file in the given folder. It doesn't work, but neither does it give an error message. However when I later use the statement: doc = REXML::Document.new(file) my script aborts with the error message: uninitialized constant REXML.
If ANY of the files in the folder were loaded, that constant (the name of the module) would have been initialized.
I am running on Windows XP (64 bit). Anyone have any ideas what I can do? This is an extremely basic behavior to have break.
Thanks,




