Thursday, March 29, 2012

Ruby on rails installation on ubuntu

1. What is Rails ?

Rails is a full-stack framework for developing database-backed web applications according to the Model-View-Control pattern. From the Ajax in the view, to the request and response in the controller, to the domain model wrapping the database, Rails gives you a pure-Ruby development environment. To go live, all you need to add is a database and a web server.

2. How to Install it on Ubuntu ?

2.1 First we need to install Ruby and irb (Interactive ruby shell) and we'll add ri and rdoc. The recommended Ruby version for rails is 1.8.5.
      Open your terminal and type: 

     >$ sudo apt-get install ruby irb ri rdoc ruby1.8-dev
To check Ruby version

     >$ ruby -v
2.2 Then we need to install RubyGems. RubyGems is installed from tgz file.We are going to install RubyGems with the following command

     >$ sudo apt-get install rubygems

Then we'll update RubyGems with command:

     >$ sudo gem update --system

Now we have the correct version, and best of all when we want to uninstall it we can just do it with synaptic.

2.3 Now we will install rails with command:

     >$ sudo gem install rails --include-dependencies 

To check Rails version

     >$ rails -v

And we are done !! You have successfully installed Ruby on Rails.

To create new project type in terminal

     >$ rails new App_name

3.How to uninstall all ?

To uninstall all I suggest you first remove rails gem:

    >$ sudo gem uninstall rails

and then uninstall rubygems and ruby:

    >$ sudo apt-get remove rubygems ruby irb ri rdoc ruby1.8-dev

I hope you will find this HOW TO useful!... Enjoy railing  

No comments:

Post a Comment