Continuing with setting up the Slice, we need to install Ruby, rubygems and Nginx.
We'll install Ruby via aptitude and then install rubygems from source (as that will give us the latest version).
Once done, we can go ahead and install Nginx, a lightweight web server, via aptitude.
Ruby and rubygems
Installing Ruby via aptitude will give us the latest version (as of writing this article) and is a nice and easy way to ensure that if there are any security patches, they can be easily installed.
Rubygems will be installed via source code as the packaged version is 0.9.4 and the latest version is 1.0.1. It is highly recommended you use the latest version and so take the time to install via source.
A full run down of installing Ruby and rubygems is shown here
Note the article does include installing and configuring MySQL. You are, of course, free to skip that section as we will be using sqlite3 for this Capistrano series.
Once done, you should have the following Ruby version installed on your Slice:
ruby -v ruby 1.8.6 (2007-06-07 patchlevel 36) [x86_64-linux]
and rubygems should output this:
gem -v 1.0.1
Excellent. Now we can move onto installing Nginx.
You can use any web server that is capable of proxying to a mongrel cluster such as Apache 2.2+, etc but I have chosen Nginx as it is a light weight server that is ample for our needs.
Future articles will look at the Litepseed web server so we don't have to proxy to another server, etc and so avoid all the clumsy requests and configurations.
However, for the moment, Nginx with mongrels will more than suffice and will give us a solid base to work from.
This is pretty easy to do as the package manager (aptitude) has Nginx.
sudo aptitude install nginx
Er, that's it.
Pretty simple. For more information, check out installing Nginx via aptitude.
One of the final packages to install onto the Slice is the database and associated libs.
In this application we're using sqlite3 as the db. You can, of course, use MySQL, postgres or any of the supported db's but for simplicity we're going to use sqlite3.
All we need to do is this:
sudo aptitude install sqlite3 libsqlite3-ruby
That's it for the database but do ensure you have the required packages and libs installed on your local workstation (how you do this will depend on what OS and distro you are using on your workstation and is beyond these articles).
By now, you will see the complete setup starting to take shape - we have installed and secured the Slice and subversion is up and running.
Now we can add to that list as Ruby, rubygems, Nginx and sqlite3 are installed.
The next article will look at installing Rails and creating a test vhost for Nginx.
Once that is done, we'll move onto Capistrano and deploying our application.