I have been successful getting an installation of Ruby to work with my plugins on the PC, and am now trying on the Mac without success.
On PC, I copied the lib folder of a 1.8.6 p287 release into my plugin folder, and added this path to $LOAD_PATH, and it works fine. The problem is that I'm using stringio and zlib, which are compiled .so files on PC and appear to be .bundle files on the Mac. On Mac, I was able to find these libraries in:
/usr/lib/ruby/1.8/universal-darwin10.0/
Unfortunately, requiring the stringio.bundle or zlib.bundle from this location is causing a bugsplat in SU. I'm assuming this is because of a version difference (ruby -v in a terminal gives version 1.8.7, but SketchUp is running RUBY_VERSION=1.8.5).
I need to find a reasonable way to work with Ruby on a Mac. I am reading that Lion is shipping with 1.8.7 and Leopard with 1.8.6 (although I'm running Leopard and it's 1.8.7). If SU8 Mac only plays nice with 1.8.5, then I have two options:
- Replace the SU Ruby interpreter with the 1.8.x version I like.
- Find versions of zlib and stringio that SU's interpreter will recognize and include them with my plugin.
I did #2 on PC by downloading 1.8.6 p287 and copying the libraries I needed into my plugin, but I don't know how to find these for the Mac (that is, 1.8.5 versions of zlib and stringio). #1 would be acceptable if it was only my machine, but I can't be replacing my users' SU Ruby interpreter when they install my plugin (that would be super selfish and could cause major conflicts with other plugins.)
Has anyone else solved this problem before? Anyone know where I can get 1.8.5 versions of zlib.bundle and stringio.bundle to try out with SU's Ruby?