I have been installing Ruby on Rails based on the instruction from edX online class.
Here is a list of terminal commands, and, where relevant, corresponding output
sudo apt-get install ruby-dev
worked for me