Tuesday, 19 April 2011

How to install Ruby on Ubuntu powered systems

Here's the first step to teach your system how to interpret ruby's methods and classes.
slap1 =>Install Ruby Interpreter.

The best and easiest way to install ruby interpreter in your system is by using 'Ruby Version Manager" a.k.a RVM. So, go and install it right away
Once done installing, just run through this commands. :

$ rvm get head  # Make RVM to go and get the latest records
$ rvm reload     #once done fetching latest records, update local records. NOTE: installation not yet started.
$ rvm list known # List Ruby interpreters available or installation
$ rvm list #lit Ruby Interpreters you've already installed

# START INSTALLING RUBY
$ rvm install 1.8.7-p174 # One of the interreters selected from the  (rvm list known) list
$ rvm install 1.9.2  # I'll install 1.9 version too. Why?? bcoz i'm kew........l. Not necessary for you. Opt the verson you like most.

Now, out of various version i've installed which one should i make default?? 1.8 or 1.9 ?or should i use any ruby interpreter??
If answer to any of above question is TRUE(YES) proceed
$ rvm use 1.9.2  # user ruby 1.9.1 OR simply  "rvm 1.9.2"

confirm  your ruby version by running this command in shell.
$ ruby -v

Still need help
$ rvm --help

$rvm gemset --help 


System wide install is no longer exist.
Use this command in Ubuntu console to install rvm as root and be available for all users:

it'll install your rvm in /usr/local/rvm .

now, add  this line in your ~/.bashrc file



change the line that goes like  [-z "$PS1"] .. to this


if [[ -n "$PS1" ]]; then
..
.....
Now, in the last, append these lines


[[ -s "/usr/local/rvm/scripts/rvm" ]] && source "/usr/local/rvm/scripts/rvm"


fi 


last 'fi' to end the upper if block. :D



4 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. Updated version:
    http://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0CB4QFjAA&url=http%3A%2F%2Fblog.sudobits.com%2F2012%2F05%2F02%2Fhow-to-install-ruby-on-rails-in-ubuntu-12-04-lts%2F&ei=DoVqUK-KAsvQrQexw4A4&usg=AFQjCNHIp2ZYw6-h48ySeHt0l1-FOGqt_g&sig2=YV9BHsF4qjWHcXqSvjLKog

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. http://blog.sudobits.com/2012/05/02/how-to-install-ruby-on-rails-in-ubuntu-12-04-lts/

    ReplyDelete