Monday, January 18, 2010

Howto Install Ruby 1.8 and RubyGems from source on Debian

In the latest addition to the, "Howto Install stuff from Source on Debian", series, this post shows how to install Ruby 1.8 and RubyGems from source on Debian.

This installation has been tested out successfully on Debian Lenny, and Debian Etch. It should also work on Ubuntu.


As noted in my last post, my user has write permissions to /usr/local/src so I don'thave to run everything under sudo. This was accomplished by allowing the staff group to write to /usr/local/src , giving write access to the staff group, and adding my user to the "staff" group.

If you would like to set this up...

# sudo chown root:staff /usr/local/src
# sudo chmod 775 /usr/local/src
# sudo usermod -a -G staff your_username

If you were not previously a member of the staff group you will need to logout and login again, or just open a new shell, for the changes to take effect.


A browser friendly version of the script can be seen at

Once again, I've leveraged gist as a tool to store my installation scripts.

The script is just a wrapper to install the necessary Debian packages. This script then downloads a second script which actually downloads, configures, and install Ruby 1.8 and RubGems.

Not only is gist a very useful tool, but I've also found GitHub to be an excellent online git repository.

The scripts use the "Raw" versions of the gists.

To install, run these commands...

# wget
# chmod a+x ./
# ./

If all goes well, Ruby and RubyGems will have been installed.

# which ruby

# ruby -v
ruby 1.8.7 (2010-01-10 patchlevel 249) [i686-linux]

# which gem

# gem -v

Enjoy Ruby!

Other Posts in this Series

Friday, January 15, 2010

Install Nginx from source on Debian

I thought it was time to write a followup post to, Install Memcached from source on Debian Lenny.

At this moment, Debian provides Nginx 0.6.39 and I was wanting to run Nginx 0.7. The latest stable version is 0.7.64, so I thought I would put together a script to automate the download and installation for me.

Some devoted Debian users will want to string me up for installing a source package, and some others will no doubt say that I'm hating Debian for not using aptitude. These people are entitled to their opinion of course, but I don't feel that there is anything wrong with installing a source package on Debian.

If you feel like installing a package from source makes Debian cry, leave now :)