How to Install Ruby 2.0 and RubyGems 2.1.11 on Ubuntu 13.10 from source

Ruby is an open source, object-oriented scripting language, best known for its use in the Ruby on Rails framework. The amount of Ruby code being written suggests it’s genuinely popular and will be around for quite some time.
This is a quick tutorial on installing Ruby 2.0 and RubyGems 2.1.11 on Ubuntu 13.10 from source. You can download, compile and install Ruby from source code on a Linux VPS with Ubuntu 13.10 OS in less than 5 minutes using the following steps:

Update the Ubuntu package lists from the repositories to get information on the newest versions of packages and their dependencies, then install Ruby dependencies using the following commands:

sudo apt-get update
sudo apt-get install build-essential git-core curl sqlite3 libsqlite3-dev libxml2-dev libxslt1-dev libreadline-dev libyaml-dev libcurl4-openssl-dev libncurses5-dev libgdbm-dev libffi-dev

Download and extract the latest stable version of Ruby available at http://ftp.ruby-lang.org/pub/ruby/ (the latest stable version at the time of writing this tutorial is Ruby 2.0.0-p247):

cd /root/
wget http://ftp.ruby-lang.org/pub/ruby/ruby-2.0.0-p247.tar.gz
tar xvzf ruby-2.0.0-p247.tar.gz
cd ruby-2.0.0-p247
make install

Once the install process is complete, verify the version of Ruby:

ruby --version
ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-linux]

RubyGems is a sophisticated package management framework for Ruby and it can be easily installed using the following steps:

Download the latest version of RubyGems available at http://rubygems.org/pages/download , then extract and install it on the virtual server:

cd /root/
wget http://production.cf.rubygems.org/rubygems/rubygems-2.1.11.tgz
tar xvzf rubygems-2.1.11.tgz
cd rubygems-2.1.11
ruby setup.rb

Verify the version of RubyGems using the following command:

gem --version

Ensure you have the latest gem versions:

gem update --system

Install all of Rails and its dependencies through RubyGems:

gem install rails

List the installed gems:

gem list
*** LOCAL GEMS ***

actionmailer (4.0.1)
actionpack (4.0.1)
activemodel (4.0.1)
activerecord (4.0.1)
activerecord-deprecated_finders (1.0.3)
activesupport (4.0.1)
arel (4.0.1)
atomic (1.1.14)
bigdecimal (1.2.0)
builder (3.1.4)
bundler (1.3.5)
erubis (2.7.0)
hike (1.2.3)
i18n (0.6.5)
io-console (0.4.2)
json (1.7.7)
mail (2.5.4)
mime-types (1.25)
minitest (4.3.2)
multi_json (1.8.2)
polyglot (0.3.3)
psych (2.0.0)
rack (1.5.2)
rack-test (0.6.2)
rails (4.0.1)
railties (4.0.1)
rake (0.9.6)
rdoc (4.0.0)
rubygems-update (2.1.11)
sprockets (2.10.0)
sprockets-rails (2.0.1)
test-unit (
thor (0.18.1)
thread_safe (0.1.3)
tilt (1.4.1)
treetop (1.4.15)
tzinfo (0.3.38)

That’s it! You now have a full Ruby on Rails stack up on a Linux VPS with Ubuntu 13.10.

Of course you don’t have to do any of this if you use one of our Linux VPS Hosting services, in which case you can simply ask our expert Linux admins to install Ruby and RubyGems on your server for you. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.

Categories: Tutorials

View Comments

Leave a Comment