Rails 101

Written by Mahabub I.

There is a few awesome frameworks which is almost like ruling the worlds of Web Development. If I start to count there is some heavy amount of PHP frameworks like CodeIgniter , Laravel , Phalcon , Yii , Zend , ASP .NET or Python Django and ofcourse many more .

But there is another one which has almost too loyal stream of follwer , and that is “Ruby On Rals”. There can be question , “why ?”

The answer would be , “Personally I tried php , and ASP .NET , but after trying RAILS , well , I can discover more with it”.

So you are free to do some research and googling , And if you make your mind about Rails , You can start this 101 article. I am going to help you install Rails in your computer and get going.

Step 1:

I am running Ubuntu and I have RVM preinstalled. If you want to learn more about RVM then please read my previous article Getting RVM. You also can install ruby in your windows machine by installing Rubyinstaller and PIK (which works almost same as RVM in Windows).

After getting ruby / rvm installed you can go to your Terminal or hit ctrl + alt + T which will bring up your Terminal . Then in that type ,

$ gem install rails 

This will have rails installed in your computer. Or if you would like to have a rails gem without documentaion , you can type

$ gem install rails --without documentaion  # this will get rails without docs 

Step 2:

Now if the installation is done you can go into your terminal and type:

$ rails --version

Which will bring up the version that has been installed. Now you can go to your preffered location in your computer and create rails app. Or , do it like me,

$ cd 	# This will take you to Home directory

$ mkdir workspace_rails		# This will make a new directory in your home path

$ cd workspace_rails		# changing current directory into newly made directory

$ rails new app 		# This will make a new rails app named "app" 

Step 3:

After full installtion of a rails app , you can change the path to your new app and get the first running app , by typing,

$ cd app

$ rails serve

This will bring up the new shiny app in a prebuilt and installed server , and you can see your app by going into your browser and typing localhost:3000 in address bar. And by this time you should be having a screen like this,

So , you are now ready to go with your new rails app . This is a 101 , and any comment welcome. Until next time , take care.

Written by : Mahabub Islam

Done At: Jan 19,2015