Tuesday, 11 December 2012

Hi,

Here I start with the installation steps for installation of latest version of Ruby on Rails using rvm(Ruby Version manager) on Ubuntu system.

Once you install the Ubuntu OS on your machine, firstly run:
 sudo apt-get update

This process will take some time.

Now, steps for RoR 3.2.x installation:

Step 1: Install curl
$apt-get install curl

Step 2:Install RVM
$bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)

This process will take some time. Please be patient.

Now,
$rvm requirements
to check if rvm command is recognized. It might prompt:
The program 'rvm' is currently not installed.
then do the following:

$source /etc/profile.d/rvm.sh

$rvm requirements


Once rvm is installed,

$rvm -v

rvm 1.17.2(stable) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]


Step 3:Installing the pre-requisites for ruby

$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 pkg-config

Step 4: Installing ruby-1.9.3

 $rvm install ruby-1.9.3-p125

This process will take some more time.

Now check for the ruby version:
$ruby -v
ruby 1.9.3p125  (2012-02-16 revision 34643) [i686-linux]

rvm --default use ruby-1.9.3-p125

Step 5: Updating gem
$gem update --system

$gem -v
1.8.24

Step 6: Installing rails 3.2.x


$rvm ruby-1.9.3-p125@rails32 --create --default

Now,

$gem update bundler

$bundle --version
Bundler version 1.2.3

$gem install rails


Now, check the rails version installed:
$rails -v
Rails 3.2.9

Installing the javascript:

$apt-get install nodejs

Now,
$gem install bundler

Step 7:Create a new rails app:
$rails new mystore

Congratulations! You have successfully installed rails 3.2.x version and go railing via MVC architecture ;)


Note: Once you reboot your system, your version of ruby may downgrade to ruby 1.8.7.
and it may prompt "The program 'rvm' is currently not installed.", then run the following command:

$source /etc/profile.d/rvm.sh

Now, your version of ruby and rails is again the upgraded version:

$ruby -v
ruby 1.9.3p125  (2012-02-16 revision 34643) [i686-linux]

$rails -v
Rails 3.2.9