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.

Permissions

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.

Install

A browser friendly version of the script can be seen at http://gist.github.com/271029.

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 http://gist.github.com/raw/271029/d16c8acf620047b88e509ccab205959681fd443d/install_ruby18_on_debian.sh
# chmod a+x ./install_ruby18_on_debian.sh
# ./install_ruby18_on_debian.sh

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

# which ruby
/usr/local/bin/ruby

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

# which gem
/usr/local/bin/gem

# gem -v
1.3.5

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 :)