Installing ruby gems in Sketchup

Gem.install "rubyzip"

Having said that, under Windows not all gems will install because some of them need to compile binaries. Under OSX this works out of the box because there is a system compiler available. But for Windows it usually require DevKit from Windows Ruby Installer to be on the system - not something end users will have installed, only developers. So you will find it a bit hit and miss to which one you can use on both platforms.

Under Windows you have the Windows Ruby Installer: http://rubyinstaller.org/
They also host the DevKit to build Ruby yourself.

Under OSX it’s much harder, but you have RVM: https://rvm.io/

But getting Ruby 1.8 i386 working on Mavericks is a pain. I eventually gave up.

If you want to compile Ruby C/C++ Extensions to be used with SketchUp use our Hello World example at GitHub: GitHub - thomthom/ruby-c-extension-examples: Ruby C extension examples

It include the Ruby headers we use with SketchUp and set up with Visual Studio and XCode projects - matching what we use when building SketchUp.

2 Likes