How to install Ruby on Rails with RVM on Ubuntu 10.10

Hello everybody! As you know, I’m still a beginer at Ruby on Rails, but what I can say is that I’m having fun with the language and the framework. So, a friend of mine helped me on installing Rails for the first time, and that’s why I’m giving him the right credits.


If you are like me, still a newbie and would like to learn a cool stuff. Here it goes something very useful, first of all, you must have Rails installed to start practicing.

I decided to go through this step-by-step, trying to simplify the whole thing and it gives me more space to explain every single command. Everything will be done using your terminal, some of them with sudo and some without.

So, let’s end the chit chat and start our job.

Step 1: Let’s make sure that our Ubuntu is up to date.

1 $ sudo apt-get update 2 $ sudo apt-get dist-upgrade 3 $ sudo apt-get install build-essential

PS: Last one is to install packages we’ll need to compile our software.

Step 2: Once we’ve got the tools it’s time to install MySQL and Ruby, altough if you’d like to use SQLite instead of MySQL. As you know, as soon as you install MySQL, it’ll ask you to set a root password, which you don’t have to, so, just do it the way you feel more confortable. So, copy and paste the code below.

1 $ sudo apt-get install ruby ri rdoc mysql-server 2 libmysql-ruby ruby1.8-dev irb1.8 libdbd-mysql-perl 3 libdbi-perl libmysql-ruby1.8 libmysqlclient15off 4 libnet-daemon-perl libplrpc-perl libreadline-ruby1.8 5 libruby1.8 mysql-client-5.0 mysql-common 6 mysql-server-5.0 rdoc1.8 ri1.8 ruby1.8 irb 7 libopenssl-ruby libopenssl-ruby1.8 libhtml-template-perl 8 mysql-server-core-5.0

PS: Perhaps, some of those libs won’t be found, then you just delete from the command line and execute it again.

Step 3: So, now we’re going to install ruby gems, your can go to and grab the lastest version, or simply copy and paste the code below. I’m grabing the 1.3.4 version and later update it.

1 $ wget 2 $ tar xvzf rubygems-1.3.4.tgz 3 $ cd rubygems-1.3.4 4 $ sudo ruby setup.rb

PS: After the installing, you can delete the .tgz file and also the rubygems-1.3.4 directory.

PS2: If you’d like to update to the lastest version, just follow the next command.

1 sudo gem update --system

Step 4: So now, let’s create thos symlinks:

1 $ sudo ln -s /usr/bin/gem1.8 /usr/local/bin/gem 2 $ sudo ln -s /usr/bin/ruby1.8 /usr/local/bin/ruby 3 $ sudo ln -s /usr/bin/rdoc1.8 /usr/local/bin/rdoc 4 $ sudo ln -s /usr/bin/ri1.8 /usr/local/bin/ri 5 $ sudo ln -s /usr/bin/irb1.8 /usr/local/bin/irb

Ok, It’s important to understando a little bit more about ruby gems, so you go to this website and check its manual, plus you’re able now to check your gem version typing:

1 $ gem -v

Step 5: Well, since we have already installed ruby and ruby gems here we go through rvm (Ruby Version Manager), which is a tool that allows you to manage and work with multiple ruby environments.

1 $ sudo gem install rvm 2 $ rvm-install

PS: If everything worked well, you won’t need the next step, just go to Step 7. If you had problemas on installing rvm, something like “rvm: command not found”, you probably need to install from the source.

Step 6: This step is necessary for those who were not able to install like Step 5, so check if you have git already installed, and follow the next command lines.

1 $ sudo apt-get install curl 2 $ mkdir -p ~/.rvm/src/ && cd ~/.rvm/src && rm -rf 3 ./rvm/ && git clone --depth 1 4 git:// && cd rvm && 5 ./instal

PS: In case that you don’t have git installed, here I have a simple way to do it.

1 $ sudo apt-get install git

Step 7: Ok, you have by now rvm installed. and you should have had a message like this:

Be sure to get head often as rvm development happens fast, you can do this by running ‘rvm get head’ followed by ‘rvm reload’ or opening a new shell


    ~ Wayne

So, let’s make a change in your .bashrc file:

1 $ cd ~/ 2 $ gedit /.bashrc

Add the next lines to the end of your file and then save.

1 if [[ -s $HOME/.rvm/scripts/rvm ]] ; 2 then 3 source $HOME/.rvm/scripts/rvm 4 fi

Restart your terminal and RVM should be working perfectly. Also you can check rvm version using the command:

1 $ rvm -v

If you have the same version than I do, you’re going to see this message:

“rvm 1.2.4 by Wayne E. Seguin ( []”

Step 8: So, we’re almost there. To install ruby 1.8.7:

1 $ rvm install ruby 1.8.7

To install the newest version:

1 $ rvm install ruby-head

You can select which version you’d like to use, or use one as default.

1 $ rvm use 1.8.7 2 $ rvm use 1.8.7 --default

Step 9: And now installing rails 3, before let’s create a gemset for rails 3 and then set it up for use always this gemset before created.

1 $ rvm gemset create rails3 2 $ rvm use 1.8.7@rails3 --default

Installing rails 3:

1 $ gem install rails

PS: If you had an error saying about zlib, you should try next step, of course changing to your right version.

1 $ rvm package install zlib 2 $ rvm remove 1.8.7 3 $ rvm install 1.8.7

And again, finally:

1 $ gem install rails

Well, that’s it! I’m giving the credits to my friend Jhimy for teaching me (twice) how to install on my personal computer.

Last but not least, here it goes a good way to start learning Ruby on Rails, its a book called The Pragmatic Bookshelf  – Agile Web Development with Rails, don’t be lazy and study! Smile

Ok, I’m done! If you have anything to add, and any question, use the comment area bellow!

Thanks for all the attention!



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s