Rails is an MVC web application framework packed with many productive features which are written in Ruby by David Heinemeier Hansson.

Ruby is a high-level, interpreted and Object Oriented language. Ruby originated in Japan and expanding worldwide. The secret behind its popularity because

  • is it’s easy to learn
  •  open source
  • easy to extend
  • rich in libraries
  • does not need much configuration
  • fewer bugs with less coding
  • no compilation required
  • has big community.

But on the other hand there are few drawbacks of implementing with Ruby such as Performance issues compared to languages like C and C++.

Ruby files will have the extension of “ .rb ”.

Before starting with Ruby following software should be installed:

  • Ruby
  • The Rails Framework
  • A Web Server (Apache/LightTPD/WEBrick)
  • A Database System (MySQL/SQLite/Oracle)

Open the command prompt and type ruby –v . Then you can check whether Ruby is installed or not. If it shows a version number, then type gem –version. If there are any errors follow the steps for installing Ruby freshly. It can be downloaded by rubyinstaller.org. The simple click may install your Ruby package and you’ll get RubyGems along with this package. Then you can install Rails by the command gem install rails on CMD. (Make sure you are connected to the internet.) Then check the Rails version by rails –v on CMD. Then it will give out your version number. Now you are done with installing Rails over Windows. Then run your web server and open your web browser and type http://localhost:3000 Then it will display a message like “Welcome abroad” or “Congratulations”.

Ruby on Rails Screenshot

Open the file config/routes.rb in your editor,
Rails.application.routes.draw do
get ‘welcome/index’

# The priority is based upon order of creation:
# first created -> highest priority.
#
# You can have the root of your site routed with “root”
# root ‘welcome#index’
#
# …

Then untag root ‘welcome#index’. Now refreshing your browser may show you “Hello Rails!” message in your index file. If you want to update Rails gem update rails command will automatically keep your Rails up-to-date.

Categorized in:

Tagged in:

,