Computer

Ruby on Rails for Beginners

Ruby on Rails for Beginners
Want create site? With Free visual composer you can do it easy.
Rails is a MVC web application framework packed with many productive features which is 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. 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 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 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.

Chathurika Senani
Chathurika is contributor at Nerdynaut from Sri Lanka.
Did you find apk for android? You can find new Free Android Games and apps.
  • Fascinated
  • Happy
  • Sad
  • Angry
  • Bored
  • Afraid

FB comments

Use 3dcart to create your online store.
1 Comment

1 Comment

  1. dinu

    December 22, 2015 at 9:56 am

    it’s really interesting article

Leave a Reply

Your email address will not be published. Required fields are marked *

Most Popular

​Disclaimer : Nerdynaut is a tech company which consists of professionals in respective academic fields in its functional team facing challenging roles to quench the thirst of knowledge in cyberspace. Every article and majority of artworks in this website are copyright of Nerdynaut 2017. After a written permission from the publisher, the original content can be reused or referred for promotional work of education without any modification. Expressions of mass media with intentional harm on Nerdynaut brand may be liable to criminal prosecution and civil claims for the damages caused.
Protected by Copyscape
* = required field

Copyright©2014-2017.The Nerdynaut. All Rights Reserved. A game-changing subordinate of Naut's Holdings.
Made in Sri Lanka.

To Top