How to Install Ruby on Rails on Ubuntu 12.04 LTS

This tutorial will show you how to install the Ruby Version Manager (RVM) which can be used to install Ruby, and then RubyGems, which can be used to install the Ruby on Rails framework. Finally, we’ll create an empty application and see it run:

SSH to your Pod as root, and then run the following:

root@rubypod:~# \curl -L https://get.rvm.io | bash -s stable
root@rubypod:~# source /etc/profile.d/rvm.sh
root@rubypod:~# rvm requirements
root@rubypod:~# rvm install 1.9.3
root@rubypod:~# rvm use 1.9.3 --default
root@rubypod:~# rvm rubygems current
root@rubypod:~# gem install rails

The last step could take a few minutes to complete.

Once finished, you can test creating, and then running, a new application like this:

root@rubypod:~# rails new Hello
root@rubypod:~# cd Hello
root@rubypod:~# rails server

Now, in your web browser, you should be able to go to http://youripaddress:3000/ and see the Ruby on Rails welcome screen.

Matthew McCaffrey

Leave a Reply