Introduction

By the end of this post you will have Ruby fully installed on your Solaris Server/Workstation. These instructions are written for Solaris 10 11/06, they can be easily adopted for OpenSolaris. One thing to watch out for if you are using OpenSolaris is that SunStudio 12 breaks the Ruby compile. There are work arounds to this but I have not had enough time to fully troubleshoot and solve the issue.

Getting Ready

Make sure SunStudio 11 (Do NOT install SunStudio 12) is installed on your Solaris machine before you start.

Correction Sun Studio 12 works if this is being installed under Solaris 10 11/06 and SPARC hardware. I havent had a chance to test other hardware/OS options as of yet.

Installation

Creating Required Directories

mkdir /opt/src

Download Ruby & Dependencies

cd /opt/src
wget ftp://ftp.cwru.edu/pub/bash/readline-5.2.tar.gz
wget ftp://ftp.ruby-lang.org/pub/ruby/ruby-1.8.6.tar.gz

Extract Ruby

gunzip readline-5.2.tar.gz
gunzip ruby-1.8.6.tar.gz
tar xf readline-5.2.tar
tar xf ruby-1.8.6.tar

Compile Ruby & Dependencies

Readline

cd readline-5.2
./configure --prefix=/opt/local
make
sudo make install

Ruby

cd ../ruby-1.8.6
./configure --with-readline-dir=/opt/local --enable-pthread --prefix=/opt/local
make
sudo make install

Test Installation

Run the following command to make sure that ruby is installed

ruby -v

Troubleshooting

If this fails with a command not found error your path may not be set correctly.

echo $PATH

Make sure it looks like this

/opt/local/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/sbin:/bin

Leave a Reply