codedecoder

breaking into the unknown…

ruby installation with rvm

Leave a comment

I have installed RVM in this post. make sure that RVM is installed with below command

$ type rvm | head -1 # below message will show that, your rvm is working fine and you are ready to move to ruby installation

rvm is a function

So, our RVM is up and working fine, we will now proceed to install ruby

$ rvm list known # it will list all the available type of ruby(ruby, ree,, jruby etc) with there corresponding version. choose whatever you want. I prefer ruby

# MRI Rubies
[ruby-]1.9.3-rc1
[ruby-]1.9.3-p0
[ruby-]1.9.3-p125
[ruby-]1.9.3[-p194]
[ruby-]1.9.3-head
ruby-head

# JRuby
jruby-1.6.6
jruby-1.6.7
jruby[-1.6.7.2]
jruby-head
jruby-1.7.0.preview1

# Rubinius

rbx-1.2.4
rbx[-head]
rbx-2.0.testing

# Ruby Enterprise Edition
ree-1.8.6
ree[-1.8.7][-2012.02]

$ rvm requirements # it will list the prerequisite for installing a particular type of ruby. you can something like below

Additional Dependencies:
# For Ruby / Ruby HEAD (MRI, Rubinius, & REE), install the following:
ruby: /usr/bin/apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion

$ sudo apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion # it will install the requirement mention above

$ rvm install ruby-1.9.3 #it will install ruby-1.9.3 for you. install any other ruby also if you want as below

$ rvm install ree-1.8.7 # it will install 1.8.7 version of ree for you

$ rvm list #it will show you all the installed rubies

rvm rubies

=* ruby-1.9.3-p194 [ i686 ] # see the meaning of symbol =* below, thus ruby-1.9.3 is our current ruby. also it is default one i,e will be loaded if none other is specifed
ree-1.8.7-p358[ i686 ]
# => – current
# =* – current && default
#  * – default

$ ruby -v # It will show you the current ruby version in use by your system
ruby 1.9.3p194 (2012-04-20 revision 35410) [i686-linux]

$ rvm use ree-1.8.7-p358 # so now this will become your current ruby
Using /home/arun/.rvm/gems/ree-1.8.7-p358

$ rvm list #check the difference in symbol before the listed rubies

rvm rubies

= ruby-1.9.3-p194 [ i686 ] # the default ruby
* ree-1.8.7-p358[ i686 ] # the currently used ruby. Note that you have made it current ruby in the last command

$ rvm –default ree-1.8.7-p358 # it will change the default to ree-1.8.7-p358 i,e unless you specify which ruby to use with rvm use command, this ruby will be used by your system

Author: arunyadav4u

over 7 years experience in web development with Ruby on Rails.Involved in all stage of development lifecycle : requirement gathering, planing, coding, deployment & Knowledge transfer. I can adept to any situation, mixup very easily with people & can be a great friend.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s