Ruby 1.9.2-p290 on Solaris 11 Express

By Morten Møller Riis

January 20 2012 12:05 CET

Compiling Ruby on Solaris 11 Express is easy but there are a few things you should know.

First of, Ruby 1.9.3-p0 won’t build on Solaris 11 Express. This will probably be fixed in the next preview.

Instead you’ll have to make do with 1.9.2-p290 for now.

You’ll need the gcc compiler and math headers and of course the source:

               pkg install gcc-3 header-math
               cd
               wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p290.tar.gz
               tar xvfz ruby-1.9.2-p290.tar.gz
               cd ruby-1.9.2-p290.tar.gz
               ./configure
               make
               make install   
            	

It’ll install in /usr/local/bin which by default isn’t included in path.

Here’s a one-liner for that.

               echo "export PATH=$PATH:/usr/local/bin" >> ~/.profile
            	

Then either login/logout or source .profile.

To update to newest rubygems just do a gem update --system.