Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install Ruby 2 on Ubuntu without RVM

I want to install ruby 2.0 using

sudo apt-get install ruby2.0 

But there isn't available package for ruby2.0

I want to install it using apt-get install the same like ruby 1.9.1

Any suggestions?

like image 699
Mahmoud Khaled Avatar asked Aug 28 '13 14:08

Mahmoud Khaled


People also ask

How do I install a specific version of Ruby on Linux?

Use the secure installation method. Read the installation instructions — you probably want the single-user configuration. Use rvm list known to list available Rubies and then run rvm install x.x.x to install a specific version. Use rvm use x.x.x --default to change your default Ruby.


1 Answers

sudo apt-get -y update sudo apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev cd /tmp wget http://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p451.tar.gz tar -xvzf ruby-2.0.0-p451.tar.gz cd ruby-2.0.0-p451/ ./configure --prefix=/usr/local make sudo make install

from here How do I install ruby 2.0.0 correctly on Ubuntu 12.04?

UPDATE

for ruby 2.1.5

 sudo apt-get -y update sudo apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev cd /tmp 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 

if you are still seeing an older ruby check your symlink ls -la /usr/bin/ruby from hector

like image 87
danmanstx Avatar answered Sep 20 '22 03:09

danmanstx