Wednesday, July 6, 2011

Ruby on Rails

Ruby on Rails is a web application framework written in Ruby, a dynamically typed programming language similar to Python, Smalltalk, and Perl.Ruby on Rails is Open Source Web framework that's optimized for programmer happiness and sustainable productivity.It lets you write beautiful code by favoring convention over configuration.
Ruby on Rails, often shortened to Rails or RoR, is an open source web application framework for the Ruby programming language. It is intended to be used with an Agile development methodology that is used by web developers for rapid development.

You can follow the following procedure to install the Ruby on Rails on your own pc.
Go to terminal and type
sudo apt-get install build-essential

sudo apt-get install ruby-full
Now Download the rubygem from "http://rubyforge.org/frs/?group_id=126" and copy it to Desktop and then do following step by step
cd Desktop
sudo tar -xvzf rubygem-1.3.7.tgz -C /var/src
(Here give your own version of rubygem )
cd /var/src/rubygem-1.3.7
sudo ruby set.rb
sudo gem install rails -v 2.3.8

Well you have now install Ruby on Rails ,Now its time to test it.So Create a Rails's application .Here name of Rails application is blog ,you can give your own name.

rails new blog
cd blog
script/server

The rails server command launches a small web server named WEBrick which comes bundled with Ruby. You’ll use this any time you want to view your work through a web browser.
This command will give you the following output in terminal

=> Booting WEBrick => Rails 3.0.0 application starting in development on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server [2010-04-18 03:20:33] INFO WEBrick 1.3.1 [2010-04-18 03:20:33] INFO ruby 1.8.7 (2010-01-10) [x86_64-linux] [2010-04-18 03:20:33] INFO WEBrick::HTTPServer#start: pid=26086 port=3000

With just three commands we whipped up a Rails server listening on port 3000. Go to your browser and open http://localhost:3000, you will see a basic rails app running.
Congratulations ,You are now running Ruby on Rails.

No comments:

Post a Comment