Ruby 2.0 on the Raspberry Pi

With Ruby 2.0 having just been released, I figured I'd give it a try on my Raspberry Pi (Raspbian OS). Other than, obviously, taking a while to compile the steps were pretty similar to those I've used before on OS X.

 

Firstly, if you don't already have RVM installed, installed RVM.

 

One odd thing I noticed about installing RVM on the Pi was that it automatically started compiling Ruby 2.0. I don't remember RVM automatically compiling any previous version of Ruby, but in either regard it's for not. Allowing it to complete the compilation will result in a somewhat functional Ruby, but the moment you run "gem install" you'll be greated with the following error:

 

	ERROR: Loading command: install (LoadError)
	    cannot load such file -- openssl

 

The solution for this is to allow RVM to install an openssl package, and then to re-compile Ruby.

	rvm get head
	rvm pkg install openssl
	rvm reinstall all --force
Other than some warnings about missing debian packages (which I assume is the result of Raspbian not having a port of various debian packages RVM is expecting), this will result in a correctly compiled version of Ruby 2.0 on Raspbian OS for your Raspberry Pi.