Programming, science, engineering, and more…
RSS icon Home icon English Spanish
  • Installing RVM on Ubuntu maverick

    Posted on {29-Apr-2011} Frank Vielma No comments

    In first place, what is RVM ?
    RVM is the Ruby Version Manager. It makes installing and managing several different versions and implementations of Ruby on one computer.

    Installation.
    There are two ways to install and configure RVM.

    • As a standard user
    • As root

    In this post we will do the first one.

    In first time, you will need to install zlib and others.

    Debian/Ubuntu systems:

    sudo apt-get install zlib1g-dev zlib1g libssl-dev libreadline5-dev libxml2-dev libsqlite3-dev
    • Step 1. Download and install rvm from sources. It will install in $HOME/.rvm. (You must have installed curl and git)
      bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)
    • Step 2. Now, we will complete the install by loading RVM in new shells adding the following line in a $HOME/.bashrc file.
      [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
    • Step 3.Open a new shell or run:
      source $HOME/.bashrc
    • Step 4.Test if the RVM’s installation is working.
      type rvm | head -1

      and you should get:

      rvm is a function

    Now, assuming that all is working, we could install ruby 1.9.2 as following:

    rvm install 1.9.2

    We can use ruby 1.9.2 in our system running only:

    rvm use 1.9.2

    so, we can verify what ruby’s version is running right now:

    which ruby

    you get:

    $HOME/.rvm/rubies/ruby-1.9.2-p180/bin/ruby

    But, if we want to return to the initial conditions ? No problem, you need only to run:

    rvm system

    it will return to the ruby’s system (ruby 1.8.7 (2010-06-23 patchlevel 299) [i686-linux])

    Leave a reply

    *
best web hosting