Monday, August 30, 2010

Ruby on Rails on Windows

So, you guys wanna kick start Ruby on Rails (ROR) on Windows as you can’t afford a Mac or you can’t get to work with *nix platform. Then this step by step guide just for you and what a better day to start as with the grand launch of .

Well, there’re two popular ways to install ROR on a PC with Windows OS, one is a normal installation with exe setup files and another(recommended) is through cygwin in a *nix environment under windows. I will discuss the latter one in next post.

Steps:

1)  Download Ruby Installer (1.9.2 or 1.8.7) and run through the wizard with all the defaults to install Ruby. If you don’t have a preferred IDE or editor, windows ruby comes with scite, which is pretty cool.

2)  Next, we’ll need to install some gems (standard Ruby package manager or ruby plugin libraries). So just download the RubyGems zip file, extract, then run “ruby setup.rb” in your newly installed Ruby prompt or just double click the setup.rb file. If your RubyGems system is old, update it by running (in cmd or Ruby CLI)

gem update —system

3) We will be using SQLite instead of mySQL to minimize pain.   Download the pre-compiled version of sqlite-3_7_2 (install) from the SQLite web site and sqlitedll-3_7_2.zip, unzip it and copy sqlite3.dll and sqlite3.def to your ruby/bin directory (or copy to c:\Windows\System32).

4) Now that SQLite3 is installed, just install the gem:
gem install sqlite3-ruby

5) Install all of latest Rails (gem) and its dependencies through the command line:

gem install rails –pre

6) Test ROR by Creating your application skeleton and start the server: 

rails new path/to/your/new/application
cd path/to/your/new/application
rails server

You're running Ruby on Rails! Follow the instructions on http://localhost:3000.

image

Click about your application’s environment to see the details. If you see the above screen, you’re successfully running ROR. Cheers.

6) Finally don’t forget to read the first 2 sections of this tutorial to get going http://guides.rubyonrails.org/getting_started.html

Now enjoy Ruby on Rails.

No comments:

Post a Comment