Installing Ruby on Rails on Windows 7

what is ruby on rails ?

Ruby on Rails, often shortened to Rails or RoR, is an open source web application framework for the Ruby programming language. It is intended to be used with an Agile development methodology that is used by web developers for rapid development

Installing Ruby on Rails on Windows 7

Rails was created in 2003 by David Heinemeier Hansson and has since been extended by the Rails core team

Who is already on Rails?

  1. twitter
  2. Basecamp
  3. Github
  4. Groupon
  5. Shopify
  6. Yellow Pages , and many more..

Step by step Installing ruby on rails?

Before doing the installation, This is a tools You Need :

  • Ruby
  • RubyGems
  • Rails (Gem)
  • A Database Engine

Installing Ruby on Rails on Windows 7

Step 1: Install Ruby

  1. Download the latest stable, in this tutorial i use Ruby 1.9.2-p0 and choose 7-Zip Archives.
  2. Extract them and put all the contained directories where you want your Ruby. Mine resides in C:\Ruby
  3. Add the newly installed bin directory to your path in your windows system : Open windows explorer-> right click the icon computer-> choose Properties -> in the contol panel Home, Click Advanced system settings and then click Envitonment Variables button->in the system variables click new and add new system variables like this :  Variable name : RUBY_HOME  , Variable Value : C:\Ruby, after that add it in to the path and add the bin after a semicolon to the “Path” variable like this : C:\Program Files\Common Files\Adobe\AGL;%JAVA_HOME%\bin;%ANDROID_HOME%\tools;%RUBY_HOME%\bin
  4. We have to make sure that our Ruby installation was successful. So we go to our Command Prompt “Start > All Programs > Accessories > Command Prompt” and type the following:

     ruby --version
  • Installing Ruby on Rails on Windows 7

Step 2: Install Ruby Gems RubyGems is a package management framework for Ruby

  • Download Gems :
  • Extract to C: \ RubyGems
  • If in Step 1 you use the installer, you can click 2x the file C: \ RubyGems \ setup.rb
  • If Step 1 uses 7z file, you can open a command prompt, then type :
 C:\Ruby\bin\ruby C:\RubyGems\setup.rb

if you have intalled gems, you just  upgrade to the latest RubyGems:

  gem update --system

# may need to be administrator or root

Gem ready to used .

Step 3: Install Rails

At the command prompt, type :

  gem install rails

Yups, Ruby on Rails ready for used

Step 4: Install a Database Engine

Rails is completely DB-agnostic, so we’ll describe how to install two of the more popular Database Engines: SQLite and MySQL.

How to Install SQLite

SQLite is the default database type that Rails looks for, and it’s a great, lightweight DB for Development. We’ll install SQLite3 here.

You need two files from the SQLite download page:

  • the SQLite Command Line Tool
  • the SQLite DLL

Unzip them and put the three extracted files somewhere in your path or in the ruby\bin directory. Now install the sqlite3-ruby gem:

   gem install sqlite3-ruby

How to Install MySQL

Download MySQL Community Server and install it. If you also do PHP programming, check out WAMP for an easy installation as well.

To use MySQL in Rails versions greater than 2.1, you’ll also need the MySQL adapter:

  gem install mysql

Because MySQL is not the default adapter, we’ll have to edit our database.yml file later.
Setup a First Project

Note: Rails 3 is now installed by default; these instructions refer to Rails 3.

Setting a Rails project is a one-line affair (from the command prompt):

  rails new myprojectname

This will build a directory, in which it will build the entire blank Rails project skeleton. To see your fresh project in action, navigate to your project root and run script\server:

  cd myprojectname
  rails server

Then, navigate to http://localhost:3000/ in your browser, If everything went ok you should be now looking at the Ruby on Rails: “Welcome aboard default page” :

Tagged with:

About the author


Yadi Rosadi is a Blogger, Web enthusiast, Editor and Founder of Find me on twitter, Google +, stumbleupon