Home Home > 2009 > 01 > 10 > What’s green, red, and awesome all over?
Sign up | Login

Deprecation notice: openSUSE Lizards user blog platform is deprecated, and will remain read only for the time being. Learn more...

What’s green, red, and awesome all over?

January 10th, 2009 by

openSUSE/SLES and Ruby!

Considering that my blog no-longer exists and I’ve got a couple of topics floating around in my head, I thought I’d make use of my Lizards account and contribute something useful for once.

openSUSE has quickly become my favorite development platform and Ruby is my language of choice these days.  The two together make an excellent combination and it couldn’t be easier to get started.  In the next few posts, I’ll cover how I use the Ruby scripting language with SUSE on a daily basis.

That being said, lets start with installation…

What version should I use?

openSUSE ships with Ruby 1.8.7 by default, while SLES ships with version 1.8.4 (which I believe you need the OES2 disc to install).  1.8.7 is current, but some find that the inclusion of features from 1.9 are a little too new for stability.

For this series of articles, I’ll discuss installation of 1.8.6 patchlevel 114.  Why?  Well, it’s stable and it’s what I’ve been developing with for a while now.  Once I’m satisfied that 1.9 is stable, I’ll move that direction.  You can follow along with this article and install most any version of Ruby that you like and the examples should still work.

Installation via zypper

As I previously mentioned, openSUSE comes with version 1.8.7 and SLES ships with version 1.8.4.  If you use zypper to install Ruby, you’ll be using one of those versions.  Installation with zypper is relatively simple:

sudo zypper in ruby devel_ruby

Addtionally, you’ll probably want to install rubygems, but that will be discussed further down in the post.

Installation from source

Grab the latest source (or a stable version like 1.8.6) from http://ruby-lang.org.  Installation is much like any other source package.  Simply extract the tarball, change to the given directory, and execute ‘./configure’ followed by ‘make’ and ‘sudo make install’.

Note that you’ll need the build essentials package installed, which can be found in YaST.

Extra goodies and useful ‘stuff’

Additionally, I like to install RubyGems (found at http://rubygems.org/).  RubyGems is a package management tool, much like zypper.  It’s got very simple syntax and installation is straightforward as well.  Just download, unpack, change to the RubyGems directory and issue ‘sudo ruby setup.rb’.  Sit back and watch the magic.

Alternatively, you could install it via zypper as per usual:

sudo zypper in rubygems

Documentation for RubyGems is availalbe on their site.  There are thousands of ‘gems’ available for Ruby, many of which are invaluable.

Wrapping Up

So there you have it, basic Ruby installation on openSUSE.  If you don’t already know the language, hop on over to http://ruby-lang.org and try a couple of their tutorials.  In the next few posts, I’ll cover how I use Ruby with openSUSE.  Stay tuned for topics on system automation, web development, and simple deployment with Ruby on openSUSE.

Both comments and pings are currently closed.

Comments are closed.