Blowing up a simple install

If there is one thing that's gotten me frazzled lately, it would be understanding how to get the latest Ruby to run on the latest Rails on the latest Ubuntu.

This has been a major pain point for me, in small part because apt-get doesn't want to let me get the latest and greatest packages.  It wants me to accept the months delayed versions.  I've heard that "Rails 3/Ruby 1.9.2 are still in beta!" and "No one is adopting them yet!".  This seems to be either untrue or irrelevant.  Rails 3.0 is stable, Rails 3.1 is in beta.  Adoption is good enough, books are being written and I have full confidence this is where I want to be.  I'm into Ruby on Rails for idealistic learning, not for pragmatic work.

In large part however, this has been a pain because my Linux skills are woefully inadequate.  Wget, xargs, sed? I have no idea how to use these things in practice. Oh, I have a cheat sheet on my wall at home.  I've probably read the man file once for a few commands. I once even setup a cronjob with ed. But I know my limits.

So when someone told me that rvm (Ruby Version Manager) was the solution to all my woes, I said "Great!... Why doesn't it tell me to install it with apt-get on their website?"

I want to be very clear here.  I am not saying the rvm tool, documentation, or website are not wonderful.  I am saying "I am ignorant of Linux and this (representative of all *nix programs) install process was intimidating for me."  I'm sure with additional Linux competency and package management experience the installation would look like a cakewalk.

Let me put all of the glorious bounty of the rvm install process out for you.
  • user$ bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)
  • user$ echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function' >> ~/.bash_profile
  • user$ source .bash_profile
  • user$ type rvm | head -1
  • user$ rvm notes
  • user$ rvm install 1.9.2
  • user$ rvm use 1.9.2 --default
The steps above could almost be written in Sanskrit for all I know.  There are several things I was confused by.
  • user$ - I didn't immediately identify this as the command prompt.
  • bash - Why do I have to call this explicitly?  Isn't my terminal already some flavor of bash?
  • << - I have no idea what this actually does.
  • curl - Why do I need this when I should already have wget?
  • echo - Why do I have to echo this string?  Note, I've only ever used echo for "Hello World".
  • >> operator - I really hope this means append.
  • .bash_profile - Ouch.
The .bashrc, .bash_profile, and .profile configuration files confuse me to no end.  I have no idea which one I should use, when I'm told it usually is wrong.  I tried all three and finally got it to work after having my terminal open as a "login script".  I have no idea of the unintended consequences of this action.
  • source - I know it means reload the configuration file, but I wish it actually was called reload.
  • rvm | head -1 - I don't know how this works.
  • rvm notes - Big Ouch.
I need to read the notes to find the dependencies, but I don't know why I need them, and only some of which are visible in the Ubuntu package universe directory.

I did eventually finish the install and learned a few things along the way.  RVM actually has a Basics of RVM page which actually does explain some of the issues above, although I didn't see it until after I had resolved them.  I hope that forcing myself to continue these kind of explorations will help me learn the basics of scripting that I've seemed to skip over in my IT career.