Welcome to Machine Unix

Search Below

Installing Ruby on a Solaris 10 Zone

I was very excited that Solaris 10 had a new release last week (Solaris 10 5/09) , but I discovered that it still did not include ruby programming language, I decided to install it on a Solaris 10 zone. The instructions below applies to a global zone as well but I wanted to have a development environment specifically dedicated to Ruby.

Download the latest Ruby from here. At the time I write this post, the latest release is ruby 1.9.1. Unpack the source code, and build it:

# gunzip -c ruby-1.9.1-p0.tar.gz | tar xf –
# cd ruby-1.9.1-p0
#./configure –prefix=/opt/local –enable-pthread –includedir=/opt/local/include
# make
# make install

We need to make some adjustments in our path. Here is how my path looks like with the addition of /opt/local/bin in /etc/profile:

PATH=/usr/sfw/bin:/opt/local/bin:/usr/ccs/bin:$PATH

At this point ruby,irb, and ri are in /opt/local/bin. Let’s check the ruby version:

# ruby -v

ruby 1.9.1p0 (2009-01-30 revision 21907) [i386-solaris2.10]

In addition to Ruby, we can also go ahead and install Rails

# which gem

/opt/local/bin/gem

# gem install rails –include-dependencies

Now, test your application

# rails mytestapp

Now you installed ruby and rails you can write your favorite ruby programs and rails applications in a Solaris zone.
Cheers…

Leave a Reply

Your email address will not be published. Required fields are marked *

You can use these HTML tags and attributes <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>