Monday, July 29, 2013

Switching between various versions of ruby on Ubuntu machine

Initially I feel very difficult to switch various ruby version installed on Ubuntu machine. But after collecting the following information it become easy. So the steps to change the ruby version is as follows:


  1. Open the terminal window
  2. Then type the following command:

    update-alternatives --config ruby

  3. This will list all the installed versions of ruby. Like :

    There are 2 choices for the alternative ruby (providing /usr/bin/ruby).
      Selection    Path                Priority   Status
    ------------------------------------------------------------
    * 0            /usr/bin/ruby1.8     50        auto mode
      1            /usr/bin/ruby1.8     50        manual mode
      2            /usr/bin/ruby1.9.1   10        manual mode


  4. And the console will wait for user input. Like:

    Press enter to keep the current choice[*], or type selection number:

  5. Choose your desired ruby version and press enter.
So now you are ready to use various version of ruby without using rvm.

Enjoy!!

No comments:

Post a Comment