Notes

Install Ruby on Ubuntu

Edit on GitHub

Linux
2 minutes
 1# update packages
 2sudo apt-get update
 3# install curl if not already there
 4sudo apt-get install curl -y
 5# install RVM
 6\curl -L https://get.rvm.io | bash -s stable
 7# load RVM
 8source ~/.rvm/scripts/rvm
 9# install RVM dependencies
10rvm requirements
11
12# install ruby
13rvm install ruby
14# use default ruby version (latest)
15rvm use ruby --default
16# install rubygems
17rvm rubygems current
18# install Rails
19gem install rails

notes

  • the setup seems to be user specific

issues

  • rvm requirements needs to be run as root. may require a password. sudo rvm rquiremenst for some unknown reason does not seem to work.

more on rvm requirements issue

  • the error happens when there are broken sources in /etc/apt/sources.list or /etc/apt/sources.list.d/*.list x
  • the broken source list is because “Ubuntu 12.10 is not supported any more since May 2014. You either need to update to a more recent version of Ubuntu (i.e. 14.04), or find an alternative repository.” x
  • solution sudo apt-get update && sudo apt-get install update-manager-core && sudo do-release-upgrade x
  • the problem with the solution: Ubuntu can only be updated to the next version. Direct upgrades to the latest version only works LTS to LTS. In my case, the server is still on 12.10 (12.04 was LTS, the latest at the moment is 14.04 has already arrived) the best strategy at this point is to take backups and restore on a fresh install of latest version.