Installing ROR on Windows
In order to set the ROR environment on your windows box, you have to perform the following installation steps:- Install Ruby – the language
- Install Ruby Gems – the plug-in manager for Ruby
- Install MySQL – the database
- Install MySQL query browser / MySQL admin tools – GUI to create databases, add users and create tables
- Install Rails Framework
I. Installing Ruby
Download the latest Ruby one click window installer from http://rubyinstaller.rubyforge.org/wiki/wiki.pl. Run the installer and you are
are done. I usually set the path of Ruby folder on my C:\ drive under C:\Ruby folder. Verify *PATH* variable by running command "path" in
the command prompt. If you have installed it in C:\Ruby folder, it will be C:\Ruby\bin.
Verify the version of the Ruby, you just installed above. Open the command prompt and go to ruby folder. In my box, I go to C:\ruby.
Type ruby -v. It will print the version of Ruby you have installed. In my box it displays:-
ruby 1.8.6 <2007-09-24 patchlevel 111> [i386-mswin32]
2. Installing Ruby Gems
Installing Ruby in the first step using one click installer will also install Ruby Gems.
3. Installing MySQL
I'll suggest downloading MYSQL 5.0.83. The latest version (5.1) have some problems with Rails and IDE (Netbeans). You can get it from http://dev.mysql.com/downloads/mysql/5.0.html#win32. Unzip and run setup exe file. Follow the following steps to set up Instance configuration.- Select “Detailed Configuration”. Click Next.
- Choose “Developer Machine”. Click Next.
- Choose “Multifunctional Database”. Click Next.
- Select the drive where you want to intall MySQL instance. Usually (in my box as well), it is main drive (C:). Click Next.
- Choose “Decision Support / OLAP”. Click Next.
- Check “Enable TCP/IP Networking” and also check “Strict mode” (it is checked by default). Click Next.
- Choose “Best Support for Multilingualism”. Click Next.
- Select both options (Install as Windows Service and Include Bin Directory in Windows Path) checked. Click Next.
- Check Modify security checkings. Enter a new root password. Uncheck “Enable root access from remote machines”. Do not create an Anonymous Account. Click Next.
- Click "Execute" and it will start the configuration on your computer. It will take 2-3 minutes. If everything went well, you will see green ticks against all installion steps.
4. Installing MySQL query builder / MySQL admin tools
Download these from http://dev.mysql.com/downloads/gui-tools/5.0.html. MySQL admin tool allows you to easily manage database
(creating users, backup etc).
Query browser allows you to query your database.
After downloading run the set up file. After installation, when you run Query Browser or Admin tool, you will be asked to enter
Server Host (by default it is localhost, so do not change it), port number (3306 is default, so do not change it), username (
root is default) and password (which you created while installing MySQL). Once you log in, you have to option to create new
database (MySQL Admin) or you can write SQL queries to browse data (Query Browser).
5. Installing Rails
This is the last step. Launch the command prompt and go to ruby directory. Run the following command "gem install rails --include-dependencies".
This will take 8-15 minutes so be patient. Once it finishes, you have installed ROR on your system. You are ready to "Rock n Roll".
Testing your installation.
a) Create a folder in your system e.g. sampleproject in C:\
b) Launch command prompt and go to this folder.
c) Run the following command: rails webonrubyrails.
d) It will create a folder C:\sampleproject\webonrubyrails.
e) Go to this folder through command prompt. and run ruby\script server. This command will start the server for webonrubyrails
rails application. Test your new web application by going to the following address in your browser:
http://127.0.0.1:3000/. You will see welcome aboard page.