Wednesday, June 6, 2007

Running Ruby on Ancient Solaris Boxes

If you think I hate Ruby, well I hate Solaris even more. It's lack of GNU. Hell, it's lack about about anything useful built-in. It's like *BSD on steroids.

But believe it or not I (sort of) even managed to get Ruby 1.8.6 built and (sort of) running on an old 2.6 and 2.8 box today. It nearly killed the 2.6 box (an Ultra-5) but here's how I did it:

  • Make sure you at least have gcc, GNU Make, and a version of of GNU Grep in your path somewhere. You probably need more. The latter were things that I know I tripped up on.
  • Rip out most of the directories in ext. All I had left in mine were: enumerator, etc, fcnctl, io, pty, racc, socket, socket, stringio, strscan, syck, thread.
  • If you need to use YAML, change the first require in yaml.rb to require 'yaml/stringio'
There may be a less radical (or lazy) way to solve the external library problem (like install readline and ncurses and everything else that wouldn't build) but I didn't want to bother, because I don't want to deal with any external libraries. I will admit, that given the minimal features built into Ruby (a good thing!) it was probably much easier to get Ruby built than Python on these old boxes. However, Python probably has a lot better detection of libraries. It certainly has a lot more ./configure options that are useful and that actually get used.

But be warned, all I ran was a simple hello world app and parsed a YAML file, so it will be interesting to see what works and what sends these boxes to a timely death.

No comments: