Install ruby-2.0.0-p195 on Ubuntu 12.04

It’s always easier to deal with a ruby binary that’s installed server-wide rather than a local user installation (done via rvm or rbenv). Server initialization scripts don’t need to do path magic and profile sourcing in order to find the correct binary. Here I how to install ruby-2.0.0-p195 in a way that your system administrator will love you for.

System administrators maintain their servers like they would maintain a well-tended garden: clean, organized, and everything in its place. It’s no surprise then that when we developers start compiling “stuff” left and right, our sysadmins get annoyed out of their minds.

There is a common ground though, and that’s through using checkinstall. This allows us to:

For the impatient, it’s as easy as copy-pasting this line in your terminal:

curl -Lo- | bash

Caveat My preferred deployment environment uses passwordless login through SSH keys; you might need to run this script as root. Your mileage may vary depending on how different your environment is from mine.

This may not work on situations where a single server will need to host multiple ruby versions. In that case, you’d definitely need a ruby versioning manager such as rvm or rbenv. But if you don’t need to support multiple ruby versions in one server, simplify your life (and save your sysadmin’s sanity) by using a ruby binary that’s installed server-wide through checkinstall.

Here’s the whole script:

comments powered by Disqus