Requiring Socket on Mac crashes SU
-
I'm trying to require the socket library as per http://forums.sketchucation.com/viewtopic.php?f=180&t=33759&p=296886&hilit=socket#p296886
However, when I execute the require statement, SU crashes. Has anyone else successfully used the socket library with SU 8 on Mac?
-
Does it cause a BugSplat! ??
Did you try the test script I posted at http://forums.sketchucation.com/viewtopic.php?f=180&t=33759&p=297366#p297366 ??
Sketchup on Mac uses the Ruby 1.8.5 (initial release, aka p0,) ... but your Apple installed Ruby may be a newer version and/or patch level. Determine what the OEM installed Ruby version is.
-
Hi Dan. I was hoping you were gonna see this thread
I did try the test script, and then I did what you said and copied the entire directory and renamed it to the RUBY_PLATFORM that the SU Ruby console spit out. When I re-ran the script SU crashed. I then tried executing the script line by line, and it crashed on:
Kernel.require('socket')
When I tried to do a require with the absolute path to the socket library, it crashed.
I am using RVM with Ruby 1.9.2. But even when I told RVM to switch back to system Ruby it still crashed.
System ruby: ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]
I'm not sure what a BugSplat is, but I've attached the screen that pops up after SU crashes.
-
@jammur said:
I am using RVM with Ruby 1.9.2.
Sketchup cannot deal with Ruby 1.9.2, as the 1.9.x branch has too many differences.@jammur said:
But even when I told RVM to switch back to system Ruby it still crashed.
On the PC we have been able to get Sketchup to load the latest Ruby patchlevel of 1.8.7 (I suppose the C header files are close enough to each other within the 1.8.x branch.)I wrote that (copy directories idea) only as a suggestion, awhile back. Keep in mind I do not have a Mac, so I cannot do any testing. There is also a symbolic link involved that needs to point at the Ruby to load.
I think now it is more complex on the Mac than just copying a set of directories. From things I have read, it seems that libraries need to be linked properly. That means that the API that the Mac Sketchup loads is linked at compile time to a specific binary (the framworkized Ruby 1.8.5-p0.)
There was a guy who claimed to have solved this challenge (getting Mac Sketchup to load another Ruby framework,) but he never explained exactly how, and did not reply to my request for more info.Anyway.. for now.. using RVM try installing a 1.8.5-p0 Ruby (or perhaps the latest 1.8.5 patchlevel,) and use a !loadpath script, to add library paths to the $LOAD_PATH array.
So far... I don't think anyone has had any success using sockets with Sketchup.
@jammur said:
I'm not sure what a BugSplat is, but I've attached the screen that pops up after SU crashes.
Yea that looks like the Mac equivalent of the BugSplat! window we see on the PC. It will send a crash report to the Google Sketchup Development Team in Boulder, Colorado. -
I have a Win edition of a load path script, with some suggestions on modifying it for Mac:
http://forums.sketchucation.com/viewtopic.php?f=180&t=29412In your case the paths would be prepended with your user "rvm" directory.
-
Hi,
Did anyone manage to get
require 'socket'
to work on the mac?I am using the net/http classes which require the socket class but having no luck at all
-
Well the crudest but still working solution I had was to just copy paste the socket.so file to the Sketchup/Plugins folder.
I'm sure doing that is all sorts of sacrilege, but it works.
-
@unknownuser said:
Well the crudest but still working solution I had was to just copy paste the socket.so file to the Sketchup/Plugins folder.
I'm sure doing that is all sorts of sacrilege, but it works.
I have tried this but doesnt seem to work on the mac.
Are you sure this works on the mac, i copied the socket.so to the plugins directory for the pc version of my plugin which seems to work fine but doesnt on the mac -
Is it the same Ruby version and patch level that Sketchup is loading ??
It may be OK on your own machine, to move files around, but it's a no-no to distro them to others where version conflicts can cause nightmares.
See this post for more info (and a link to StackOverflow 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 -
If there is a working solution for this, i would be extremely greatful if someone could post it here.
It would be even more awesome if they could upload the files necessary to get it to load as well. -
@dan rathbun said:
Is it the same Ruby version and patch level that Sketchup is loading ??
It may be OK on your own machine, to move files around, but it's a no-no to distro them to others where version conflicts can cause nightmares.
See this post for more info (and a link to StackOverflow 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#p326274Thanks a lot!!!
I was able to change the symlinks and make it use 1.8.7 of the mac and copied the socket.bundle from that version and everything is working fine!! -
@jhyuk said:
Thanks a lot!!!
I was able to change the symlinks and make it use 1.8.7 of the mac and copied the socket.bundle from that version and everything is working fine!!Now wouldn't it be nice if Sketchup had a button that you could press or a checkbox and it automatically used your full system Ruby install instead of that old v1.8.5 initial dead release ??
Advertisement