Install ruby 2.0 without ruby-switch?

For 14.04 I found the following PPAs that come with Ruby 2.x

  • Adds Ruby 2.1 to Ubuntu 14.04

    sudo add-apt-repository ppa:brightbox/ruby-ng
    

I also found in GoRails a set of instructions to install Ruby on 14.04 but I am guessing since they are long you would want a PPA instead.

  • Adds Ruby 1.9, 2.0 or 2.1 to Ubuntu 14.04

    sudo add-apt-repository ppa:brightbox/ruby-ng-experimental
    

After you add one of them simply:

sudo apt-get update
sudo apt-get install ruby2.1 # In the case you want 2.1

Debian version of Ruby does not support several ruby installations on the same system. Debian obsoleted the package and Ubuntu just removed it from the repositories. You should use rbenv to switch between different ruby versions. This is the recommended way by ruby-switch package description and was the method that has been discussed in bug 737782 as preferred, through it's said that there shouldn't be more than only one version of ruby in the repositories.

Ruby 2.0 is installed by default when installing the ruby2.0 package and no other action is needed. If the package ruby was installed is recommended to remove it. You should have the binary /usr/bin/ruby2.0 available on your system.


sudo apt-get install ruby2.0
sudo rm /usr/bin/ruby && sudo ln -s /usr/bin/ruby2.0 /usr/bin/ruby
sudo rm -fr /usr/bin/gem && sudo ln -s /usr/bin/gem2.0 /usr/bin/gem