Getting Ruby to work on Mac
-
forum member driven was messing around with this stuff...
http://forums.sketchucation.com/viewtopic.php?f=180&t=37127&p=327328
maybe contact him for some ideas?
[or fuggedaboutit ]
-
Just found this: http://forums.sketchucation.com/viewtopic.php?f=180&t=28673&start=0#p249370
Looks to be exactly my problem. I will try linking with a flat namespace tomorrow and see if that will compile a bundle that doesn't crash sketchup.
-
I tried compiling a 1.8.5 version of Ruby on the Mac, which works if you follow the directions in the previous post about changing that compiler flag.
Unfortunately I can't find a 1.8.5 Ruby that includes the thread.bundle C extension. Several of the other C extensions depend on thread.bundle, so I haven't been able to get this working.
As a workaround I may resort to using shell commands instead of the Ruby libraries I need. This is painful since Mac comes with some programs that Windows does not (tar, gzip), so I'll have to do different things for each platform.
-
See this post for more info (and a link to a StackOverflow post that gives instructions on Mac for changing your symbolic links to force Sketchup to use a System Ruby.)
http://forums.sketchucation.com/viewtopic.php?f=180&t=31545&start=15#p326274 -
Thanks Dan.
Unfortunately since I'm distributing my plugin to other people, I don't see a way to replace the interpreter such that other plugins will be guaranteed not to break. Upgrading SU's Ruby is really only a reasonable solution if you're doing it to YOUR SketchUp and not others'.
Unless you have something in mind... But otherwise I am still looking for a way to get 1.8.5 standard libraries and extensions into my Mac SU.
-
Isn't it possible to just copy the files you need and require them in your own script? How many standard library files is it?
-
@chris fullmer said:
Isn't it possible to just copy the files you need and require them in your own script? How many standard library files is it?
I really need a full Ruby installation, including all the C extensions (zlib, stringio, thread, bigdecimal, etc... about 10-15 in total). I achieved this on the PC by copying a 1.8.6 installation into my plugin files.
So yes, I could copy files, but my Mac comes with 1.8.7, and the existing extensions in that installation do not work in SketchUp (I get a version difference error). I'm therefore trying to compile a version that will work in SketchUp, but all the 1.8.5 sources I find are missing the thread C extension.
-
Well.. probably beatin' a dead horse here, but
Ruby v1.8.5 (the entire branch,) is obsolete, and no longer being patched. (Not to mention that the initial release distro'd with Mac Sketchup is superceded by all the later patches.)
If I was a Mac only user, I'd be raisin' hell... getting a petition going, or similar to get the Mac Sketchup Ruby updated (at least equal to that of the PC.)
It would be nicer if both platforms were updated to the latest patch in the 1.8.7 trunk.
-
@draftomatic said:
So yes, I could copy files, ...
You can't on the Mac. The extensions need to be linked against the core that Sketchup is going to load.
It would be beneficial if you could figure out a way, to install an additional frameworkized v1.8.7 Ruby beneath (alongside) the Sketchup obsolete Ruby, and then have a "switching" utility that allowed the user to change the symbolic links, to load the newer Ruby.
-
@dan rathbun said:
If I was a Mac only user, I'd be raisin' hell... getting a petition going, or similar to get the Mac Sketchup Ruby updated (at least equal to that of the PC.)
It would be nicer if both platforms were updated to the latest patch in the 1.8.7 trunk.
I am in the process of raising hell to Google...
@dan rathbun said:
It would be beneficial if you could figure out a way, to install an additional frameworkized v1.8.7 Ruby beneath (alongside) the Sketchup obsolete Ruby, and then have a "switching" utility that allowed the user to change the symbolic links, to load the newer Ruby.
Sigh... these convoluted workarounds are getting old. I think it will be resort to using shell commands instead of the Ruby libraries I need. Mac comes with curl and gzip, and I believe this will eliminate my need for stringio as well.
Thank you for your input Dan. I will pass this on to Google.
Advertisement