top of page

Ruby on Rails -Introduction and SetUp

Hi guys let's Start a journey of learning on of the Most Popoular application framework Rails built on Ruby

You’ve probably already used many of the applications that were built with Ruby on Rails: Basecamp, GitHub, Shopify, Airbnb, Twitch, SoundCloud, Hulu, Zendesk, Square, Highrise. Those are just some of the big names, but there are literally hundreds of thousands of applications built with the framework since its release in 2004.

Ruby on Rails is open source software, so not only is it free to use, you can also help make it better. More than 4,500 people already have contributed code to Rails. It’s easier than you think to become one of them.

Optimizing for programmer happiness with Convention over Configuration is how we roll. Ruby on Rails has been popularizing both concepts along with a variety of other controversial points since the beginning. To learn more about why Rails is so different from many other web-application frameworks and paradigms, examine The Rails Doctrine.

What is Rails?

Rails is a web application development framework written in the Ruby language. It is designed to make programming web applications easier by making assumptions about what every developer needs to get started. It allows you to write less code while accomplishing more than many other languages and frameworks. Experienced Rails developers also report that it makes web application development more fun

We will talk more on rails now lets Setup and Start The Project...........

you need to have some prerequisites installed:

  • The Ruby language version 2.4 or newer.

  • Right version of Development Kit, if you are using Windows.( https://rubyinstaller.org/downloads/)

Installing Rails

Open up a command line prompt. On macOS open Terminal.app, on Windows choose "Run" from your Start menu and type 'cmd.exe'. Any commands prefaced with a dollar sign $ should be run in the command line. Verify that you have a current version of Ruby installed:

$ ruby -v

ruby 2.3.1p112

To install Rails, use the gem install command provided by RubyGems

gem install rails

To verify that you have everything installed correctly, you should be able to run the following:

rails --version

If it says something like "Rails 5.1.0", you are ready to continue.

Look At ScreenShot

Creating the Blog Application

Rails comes with a number of scripts called generators that are designed to make your development life easier by creating everything that's necessary to start working on a particular task. One of these is the new application generator, which will provide you with the foundation of a fresh Rails application so that you don't have to write it yourself.

To use this generator, open a terminal, navigate to a directory where you have rights to create files, and type:

rails new blog

This will create a Rails application called Blog in a blog directory and install the gem dependencies that are already mentioned in Gemfile using bundle install.

After you create the blog application, switch to its folder:

cd blog

The blog directory has a number of auto-generated files and folders that make up the structure of a Rails application.

Hello, Rails!

To begin with, let's get some text up on screen quickly. To do this, you need to get your Rails application server running

Starting up the Web Server

You actually have a functional Rails application already. To see it, you need to start a web server on your development machine. You can do this by running the following in the blog directory:

ruby bin\rails server. (Windows)

bin/rails server(Linux/MAC)

This will fire up Puma, a web server distributed with Rails by default. To see your application in action, open a browser window and navigate to http://localhost:3000. You should see the Rails default information page:

We Will upload next blog soon in Which We will talk About how to develop a full fledged Web Application using Ruby on Rails .............

Please feel free to post your question and suggestion in Comment Section

Featured Posts
Recent Posts
Archive
Related Posts
Follow Us
  • Facebook Basic Square
  • Twitter Basic Square
  • Google+ Basic Square
bottom of page