Contents

Installing Ruby on Rails on Raspberry Pi

This is a guide to install Ruby on Rails on the Raspberry Pi computer running Debian "squeeze". It will also be useful to people who just require a Ruby installation. The guide can be followed by anyone if it all goes right, but when things go wrong, it is often difficult to see what the problem is. It will take several hours to complete and requires an internet connection.

The guide has been developed/tested using debian6-19-04-2012. There is not enough room on a standard 2Gb image. I tested with an 8Gb image, but you may get away with 4Gb. Learn how to expand your image here or here.

The installation was all done from the basic (pre startx) command prompt. We will use Ruby Version Manager (RVM), so first we must install all its prerequisites:

Note: With my default Debian image and keyboard map, it was very hard to get a | (pipe) character. I got it by pressing AltGr+|

When run, you will get some messages about requirements for Ruby. You need to press 'q'. Note the computer may not react straight away as it is 'thinking'. After a few seconds, the script will download and compile ruby 1.9 and Rails. This takes a long time! (3 Hrs) Have a sleep and check in the morning.

At the end of the installation, RVM suggests that you have to run a script in order to enable Ruby. (I think I only had to do this once?)

You should then be able to Create, Read, Update & Delete (Often called CRUD) pupil records in your database.

Alternatively, if you have another computer on the same network, you can point its browser at the RPi substituting the 0.0.0.0 in the above address for the real RPi one. If you don't know the address of your RPi, then use the following command in a terminal:

hostname -I

Conclusion

We have a working installation of Ruby on Rails. It is very slow but just about usable. If this is your introduction to Ruby on Rails please don't let the speed put you off. If you follow this fantastic tutorial it will show you how to deploy to Heroku (for free), then your website will be as fast as those with proper computers.