OK, parts of this question have been posted in various forms across these forums, but for a Ruby newbie like me, it's a little bit confusing. So I hope you guys will bear with me and help me through this.
What I am trying to do is to run a script via the Sketchup Bridge executable on Windows 7. I am able to run it successfully with with my normal Ruby install, but when I try to run it using sub.exe, I get an error that it could not find a file that exists in the '../lib' folder from where I am running the script and the exe (i have put them both in the same folder).
(Note that this required file is part of some gem, but as far as I can tell, the error is occurring at the level of requiring this file, and it hasn't yet gotten to the point where it is trying to use a gem)
Now first thing I did was to try and append the path of my Ruby directory to the load path (as mentioned in http://sketchucation.com/forums/viewtopic.php?f=180&t=18712). I even outputted the new load path via the messagebox, and confirmed it was correct. But that did not seem to work, and I got the same error.
The next thing I did was to move the folder to the Sketchup Plugins folder, and I moved the file I needed from the ../lib address to the folder where the script is. However, that too did not seem to work.
At this point, according to whatever I read on the forums, I think it might have to do something with my Ruby version. My normal ruby.exe resides in a 'Ruby200-x64', so I guess that means I have version 2.0.0 for my 64 bit system installed. As per http://sketchucation.com/forums/viewtopic.php?f=180&t=29412 and http://sketchucation.com/forums/viewtopic.php?f=180&t=29544, it seems like Sketchup uses Ruby version 1.8.X, and that I need to install that version of ruby and then copy the msvcrt-ruby18.dll from my Ruby install directory to my Sketchup directory.
However, before I do carry out this operation, I would like to know - is this really the problem? Because to me it makes no sense why a script, once given the correct load paths, is not able to run on 'any' interpreter. I'd appreciate if someone could show me what I'm missing.
(As an aside, if I go ahead and install Ruby version 1.8.X, and copy the msvcrt-ruby18.dll into the Sketchup folder, will I then be able to see puts output on the command line, and be able to access installed gems as long as I have the load path right?)