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

No comments: