Sunday, March 11, 2012

Install Ruby on Rails to Windows 7




Recently i have found that i like to learn new programming language and choose ruby to full fill my desire. But all the tutorials i have found how to install rails and configure gems are outdated and it took me 3 days to create a project correctly without giving any errors about missing gems or dev kit.

So that inspired me to write a guide on how to install rails correctly. ( i further wish to write more on ruby later)

So let us start the work then.

  • First go to this website and download the latest release of  "rails installer for windows" ( at the moment i m writing this blog the newest release was 2.1.0). This installer comes with current ruby language interpreter, rails framework and dev kit, all 3 in one.

  • After downloading it double click on the exe file and follow the steps to install the setup. ( i prefer a location in top level of C drive (eg: C:\ruby) because of spaces in the path will be problematic sometimes). 

  • After finishing the installer go to start menu and find "All Programs > RailsInstaller > Git Bash " and click it. This will open a command prompt like terminal (if you have previously work with git you may find out this is the same  terminal that git has provide). Or you can use windows command prompt as well.



  • Then type "ruby -v" to check the ruby version and "gem -v" to check the gem version.


  • And then type "rails -v" where the prompt say that it is unknown command and this is because even though we installed rails it has not been configured yet as a gem. 

  • Type " gem install rails --include-dependencies " to install rails gem and you are done. ( of course this may take few time )
Installing Rails
  • Re check by typing "rails -v".



  • Create a new folder in any where you like to create ruby projects. Open a command window and "cd" to that folder. Then type "rails new testApp". ( here testApp is my test applications name you can give any name and this will be your project name". After issuing this command rails will create a ruby project for you with all the dependencies, configurations and scripts.


  • Type "rails server" to start ruby server on your localhost. Then go to your web browser and type "http://localhost:3000" . You will get a page like below. (ruby server use port 3000)

You’re riding Ruby on Rails!













1 comment:

  1. hey thanks for the info........
    but I am having a problem in starting the server.The error is"Oops! Your Rails development server probably wasn't properly started."

    ReplyDelete