How to install Ruby 2.1 on Ubuntu 12.04


You might have wondered why I am writing this post. You may have thought that ruby can be installed using
sudo apt-get install ruby
command. But note that, this command installs Ruby 1.8 on Ubuntu 12.04. But there are certain applications like Jekyll which requires Ruby 2.1 and above. But, we can install Ruby 2.1.5 using some commands. These are:

sudo apt-get update
sudo apt-get install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev
cd /Desktop
wget http://ftp.ruby-lang.org/pub/ruby/2.1/ruby-2.1.5.tar.gz
tar -xvzf ruby-2.1.5.tar.gz
cd ruby-2.1.5/
./configure --prefix=/usr/local
make
sudo make install
Basically, we have installed Ruby from its source. Now, you can install Jekyll using command:
sudo gem install jekyll

Having problems? Let me know in the comments.
How to install Ruby 2.1 on Ubuntu 12.04 How to install Ruby 2.1 on Ubuntu 12.04 Reviewed by Chirag Jain on Sunday, November 08, 2015 Rating: 5

No comments :

Powered by Blogger.