Top 5 New Features of Android N

Android N is still in its active development phase while the recent Developer Preview released by google has gained much expectation to this new version. The Final Release is planned for Q3 of 2016. Here are the Top New Features Read more

Managing your Mailing List

Emails are often the most time-consuming work for every professional, finding the important conversation amidst the noise is a real challenge. I was surprised to find that I was subscribed to more than 900+ mailing list.Think about the amount Read more

Awesome tools to make you Super Productive

Busy! The favorite word of every IT person, which signs that we are turning unproductive. The moment you feel you are busy, take a break. Breaks allow you to regain your focus, sharpens your intuition, allows you to make conscious Read more

Snapshot 2013 - A Year of Giving!

I don't believe in taking new year resolutions. But Jan 1st is surely a good place to start our life with new focus and purpose; for the next 365 days. As 2013 ends and  2014 unfolds, I would love Read more

Learning ROR: Part 7 – Ruby Gems Explained

Rails, Ruby, Ruby on Rails Voice your views   , ,

Until I work with ROR, my basic understanding of Gems were, it is a round shaped Chocolate released by Cadbury confectionery company, which comes in different colors. But Once I encountered ROR, it was something which bugged me on my initial days of learning. What is Ruby Gems, What is Gemfile, What is Source, What is Gemfile.lock, Why we run “bundle install”? So many doubts. For those who encounter a similar situation like me, or needs a brush up, this blog post would be a handy guide,

What is a Gem?

A gem is a packaged Ruby application or library. It has a name (e.g. rake) and a version (e.g. 0.4.16). Gems are managed on your computer using the gem command. You can install, remove, and query (amoung other things) gem packages using the gem command. RubyGems is the name of the project that developed the gem packaging system and the gem command

What is Gemfile and Why we use it?

It holds all the dependencies the projects needs to run smoothly.

What all a GemFile contains?

The following makes the GemFile,

1. Source of the RubyGems Server,


The above line is the always the first line of a GemFile, We need to specify the URL (or) source of the RubyGems server from where various gems required by the project are fetched.

2. Gems and their Versions needed by our Program

We specify all the required Gems along with their versions as mentioned below,


<span style="font-size: medium;">group :assets do</span>
<span style="font-size: medium;">gem 'sass-rails', '3.2.4'</span>
<span style="font-size: medium;">gem 'coffee-rails', '~> 3.2.2'</span>
<span style="font-size: medium;">gem 'uglifier', '>= 1.2.3'</span>
<span style="font-size: medium;">end</span>

<span style="font-size: medium;">

So in the above statements, we have mentioned that we need "sass-rails" gems which is of version 3.2.4, and did you observe "~>" and "=>" for coffee-rails and uglifer, Let us look into what are those,

Those Operations are used as Version Constraints,

= Equals version
!= Not equal to version
> Greater than version
< Less than version
>= Greater than or equal to
<= Less than or equal to
~> Approximately greater than

The reason we prefix this to the version numbers is to inform the bundler to install the gem in the specified version range. So you may end up with a question as to where to use "~> " and "=>". We use "~>" for gems which undergoes regular minor releases and  "=>" which has a timed stable major release.If no version constraint operator is specified, RubyGems will assume that “=” was intended.

3. Gem Grouping

We group gems so that we can tell bundler easily which set of gems to exclude (or) to include. Basically in Rails, the grouping of gems is done with respect to Environments. the three common environments are Development, Testing, Production. Here is the sample snip below we have included "sqlite3" gem within development group,

<span style="font-size: medium;">group :development do</span>
<span style="font-size: medium;">  gem 'sqlite3', '1.3.5'</span>
<span style="font-size: medium;">end</span>
<span style="font-size: medium;">

What is GemFile.lock?

When the bundler installs all the Gems in our system looking from the GemFile, it creates a quick snapshot and writes the versions installed to Gemfile.lock. This way bundler doesn't have to recalculate all the gem dependencies each time you deploy

What is Bundler?

Bundler is a program for managing gem dependencies in your Ruby projects. With Bundler you can specify which gems your program needs, what versions they should be at, it can help you install them, load them at runtime and distribute them with your software. Basically, it takes all of the guesswork out of installing the gems needed to run your Ruby projects.

Further Reading:

To know more on these, refer the following topics,

1. Some of the Problems the Bundler Solves

2. Bundler Site

3. What is Bundler?

4. GemFile

5. Optimistic Version Constraint & Pessimistic Version Constraints

It would be great, if  you add your suggestions and help links in the comment section below.

Learning ROR: Part 6 – Useful Cheatsheets

Rails, Ruby, Ruby on Rails Voice your views  

I always love to take print-outs of Cheat-Sheets (or) Quick Reference Docs and clip it to my board. When you learn ruby (or) rails, these Cheat-Sheets would be of great help in remembering the most commonly used syntax and TODO’s.

Here in this blog post,you can find some of the useful reference sheets,

1. Ruby Cheat-Sheet 1

2. Ruby Cheat-Sheet 2

3. Ruby On rails Cheat-Sheet -1 

4. Ruby On Rails Cheat-Sheet-2

5. REST Cheat-Sheet

If you find any useful Rails resources, do share them in the comment section.

Note: Cheat-Sheet will be getting older as new versions get released, So If you find any obsolete data,  would suggest you to ignore them and follow the new once. Also most of the topics in the cheat-Sheets would be fundamentals and would hardly undergo changes.

Learning ROR: Part 5 – Rails Project Directory Structure

Rails, Ruby, Ruby on Rails 3 Your Views ,

In our previous post, we created a new Project and Rails created the directories on our behalf. Before we move further, I would recommend Beginners to look into an awesome info-graphic which I recently came across, this helps us to understand the different folders used in Rails Project,

Note: A minor correction in the below info-graphic. the CSS, images and Javascript files in Public directory are moved into “assets” folder within “app” directory.

Added to the above Info-graphic, I am also listing the various project directories (from Micheal Hartl RailsTutorial) and their uses below,

File/Directory Purpose
app/ Core application (app) code, including models, views, controllers, and helpers
app/assets Applications assets such as cascading style sheets (CSS), JavaScript files, and images
config/ Application configuration
db/ Database files
doc/ Documentation for the application
lib/ Library modules
lib/assets Library assets such as cascading style sheets (CSS), JavaScript files, and images
log/ Application log files
public/ Data accessible to the public (e.g., web browsers), such as error pages
script/rails A script for generating code, opening console sessions, or starting a local server
test/ Application tests
tmp/ Temporary files
vendor/ Third-party code such as plugins and gems
vendor/assets Third-party assets such as cascading style sheets (CSS), JavaScript files, and images
README.rdoc A brief description of the application
Rakefile Utility tasks available via the rake command
Gemfile Gem requirements for this app
Gemfile.lock A list of gems used to ensure that all copies of the app use the same gem versions A configuration file for Rack middleware
.gitignore Patterns for files that should be ignored by Git

Learning ROR: Part 4 – Creating the First Rails Project

Rails, Ruby, Ruby on Rails, Tutorial Voice your views  

Now that you have installed Sublime Text 2 Editor, Ruby, Rails, its time to do our first rails program. Before getting started, if you have not worked out any of the above said tasks, do refer to the following blog posts,

1. Installing Ruby on Rails

2. Basic Rails Commands

3. Installing Sublime Text 2 Editor

Let’s get Started with our first app!

Step 1: Create a New Directory names “Sample_RailsApp” and switch into the directory

$ mkdir Sample_RailsApp
$ cd Sample_RailsApp
$ rails new hello_world
      create  README.rdoc
      create  Rakefile
      create  .gitignore
      create  Gemfile
      create  app
      create  app/assets/images/rails.png
      create  app/assets/javascripts/application.js
      create  app/assets/stylesheets/application.css
      create  app/controllers/application_controller.rb
      create  app/helpers/application_helper.rb
      create  app/mailers
      create  app/models
      create  app/views/layouts/application.html.erb
      create  app/mailers/.gitkeep
      create  app/models/.gitkeep
      create  config
      create  vendor/plugins
      create  vendor/plugins/.gitkeep
         run  bundle install
Fetching source index for
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled
gem is installed.

In the above step,” rails new” Command creates the various directories (Folder Structure) for our new rails application and runs bundle install command where it installs all gems necessary for the rails app.

Step 2: Once the new Project is generated, change directory into the project directory and run the “rails server” command to launch the WeBrick server.

$ cd hello_world
$ rails server
=> Booting WEBrick
=> Rails application starting on
=> Call with -d to detach
=> Ctrl-C to shutdown server

On executing the above command, you can open your browser with the URL: http://localhost:3000 (or) to view the Rails Welcome Page. We will replace this default Page with our custom designed HTML Home Page in our upcoming tutorials.

Congrats! You have created (Generated) your first rails Application and have setup the server. Now in the upcoming posts, I’ll we will look more in-depth explanations on how Rails Work.

Learning ROR: Part-3 Install Sublime Text 2 in Linux

Rails, Ruby, Ruby on Rails Voice your views   , , ,

If you are a Web Developer, you should definitely give Sublime Text2 a try. Its a awesome text editor with so many programmer friendly functionalities like syntax highlighting, command palette, split editing and so on.

I’ll brief the steps to install Sublime Text 2 in Ubuntu 12.04 through this blog post,

Step 1: Download the tar file from Official Website and extract it in /usr/lib/

sudo tar xf Sublime\ Text\ 2\ Build\ 2181\ x64.tar.bz2

Step 2: You need to call sublime from terminal by typing "Sublime", so let's create a symlink to /usr/bin/

sudo ln -s /usr/lib/Sublime\ Text\ 2/sublime_text /usr/bin/sublime

Now you can launch your Sublime from Terminal by typing the command "sublime". For more on Sublime Text, Checkout Official Documentation.