<?xml version="1.0" encoding="UTF-8"?>
<article-node>
  <account-id type="integer">2</account-id>
  <author>Christopher Haupt</author>
  <aux>This guide walks you through setup instructions for preparing a Windows Vista development machine to be used for general Ruby on Rails coding. This baseline setup is what we use for our LearningRails online course.</aux>
  <body>&lt;p&gt;This guide walks you through setup instructions for preparing a Windows Vista development machine to be used for general Ruby on Rails coding. This baseline setup is what we use for our &lt;a href=&quot;/course&quot;&gt;LearningRails online course&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;You will end up with a development machine with the following baseline components:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Ruby and all basic Ruby utilities&lt;/li&gt;
	&lt;li&gt;Ruby Gems package manager&lt;/li&gt;
	&lt;li&gt;Subversion client&lt;/li&gt;
	&lt;li&gt;MySQL database client utilities and server&lt;/li&gt;
	&lt;li&gt;Gems for Ruby on Rails, Capistrano, Mongrel, Mongrel Cluster, and MySQL&lt;/li&gt;
	&lt;li&gt;&lt;span class=&quot;caps&quot;&gt;SSH&lt;/span&gt; Terminal Program&lt;/li&gt;
	&lt;li&gt;Git client (&lt;span class=&quot;caps&quot;&gt;UPDATED&lt;/span&gt;)&lt;/li&gt;
	&lt;li&gt;Programmer&amp;#8217;s editor or &lt;span class=&quot;caps&quot;&gt;IDE&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Note: In the command sequences we illustrate here, command line prompts are shown as &lt;code&gt;C:\&amp;gt;&lt;/code&gt;.&lt;/p&gt;
&lt;h2&gt;Prerequisites&lt;/h2&gt;
&lt;p&gt;This guide assumes you have a Windows computer running the current Windows Vista operating system with up-to-date service patches applied (SP1 or higher). It also assumes you have not set up alternate Ruby on Rails tools prior to running through this guide. If you have, then small adjustments may be required as you walk through the following instructions.&lt;/p&gt;
&lt;p&gt;You will need to have access to an Internet connection to complete various download steps.&lt;/p&gt;
&lt;p&gt;You will need to have administrator access to your computer to complete this guide. Some of the Windows installers may ask you for your password. With most of the installer programs described below, Windows Vista will present the famous User Account Control (&lt;span class=&quot;caps&quot;&gt;UAC&lt;/span&gt;) dialog asking whether an unidentified program should be permitted to have access to your computer.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/installwinvista_uac.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;You should select the &amp;#8220;Allow&amp;#8221; option which will let the specific installer program continue. In the specific case of MySQL, the MySQL installation process is not compatible with &lt;span class=&quot;caps&quot;&gt;UAC&lt;/span&gt;. We will walk you through temporarily turning &lt;span class=&quot;caps&quot;&gt;UAC&lt;/span&gt; off so you can install MySQL.&lt;/p&gt;
&lt;h2&gt;The Recipe&lt;/h2&gt;
&lt;p&gt;Follow this recipe in sequence. If you have previously installed a particular component, you can usually skip the associated step.&lt;/p&gt;
&lt;h3&gt;Ruby and Ruby Utilities (irb, ri, rdoc)&lt;/h3&gt;
&lt;p&gt;The &lt;a href=&quot;http://rubyforge.org/projects/rubyinstaller/&quot;&gt;One-Click Ruby Installer&lt;/a&gt; does a lot of work for you by installing Ruby, Ruby Gems Package Manager, Rake, all of the other standard Ruby tools, and even the open source SciTE programmer&amp;#8217;s editor. Additionally, the installer configures the command line interface path information, so the Ruby tools are ready to use in the Command Prompt program.&lt;/p&gt;
&lt;p&gt;Download the latest installer (1.8.6 r26 as of this writing) and double click on it to get started.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/installwinvista_1click.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Select all of the default settings and let the installer complete its work. Once done, open a &lt;code&gt;Command Prompt&lt;/code&gt; (aka &lt;span class=&quot;caps&quot;&gt;DOS&lt;/span&gt; Command Line) window by selecting the Start menu, then enter &lt;code&gt;cmd&lt;/code&gt; into the Start Search text box and pressing return.&lt;/p&gt;
&lt;p&gt;You can check that Ruby is installed by typing the command:&lt;/p&gt;
&lt;pre&gt;
	C:\&amp;gt; ruby -v
	ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]
&lt;/pre&gt;
&lt;p&gt;You should seem similar responses. If you get an unrecognized command error, try closing your Command Prompt window and opening another one.&lt;/p&gt;
&lt;h3&gt;Ruby Gems Package Manager&lt;/h3&gt;
&lt;p&gt;You next need to install the latest version of &lt;code&gt;gem&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Check the version that gets installed:&lt;/p&gt;
&lt;pre&gt;
	C:\&amp;gt; gem -v
	0.9.4
&lt;/pre&gt;
&lt;p&gt;You need 1.0.1 or newer. If you have an older version, you can update with the command line: &lt;code&gt;gem update --system&lt;/code&gt;.&lt;/p&gt;
&lt;h3&gt;Installing a Subversion client&lt;/h3&gt;
&lt;p&gt;Subversion will be used to access your source code repository during development and deployments. You will need a current version of the Subversion command line client and you can use the &lt;a href=&quot;http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=91&quot;&gt;official Windows installers on subversion.tigris.org&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Download the latest &amp;#8220;Windows installer with the basic win32 binaries&amp;#8221; option on the site. Double click the setup program and select the default options.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/installwinvista_svn.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Once the installer is done, open a new Command Prompt window and check the installation:&lt;/p&gt;
&lt;pre&gt;
	C:\&amp;gt; svn --version
	svn, version 1.4.6 (r28521)
	   compiled Dec 20 2007, 16:33:06
	...
&lt;/pre&gt;
&lt;h3&gt;Installing MySQL via the Offical MySQL Installer&lt;/h3&gt;
&lt;p&gt;You will be installing MySQL via the official &lt;a href=&quot;http://dev.mysql.com/downloads/mysql/5.0.html#win32&quot;&gt;Windows Essentials&lt;/a&gt; installer from MySQL.com. This installer handles all of the setup steps for you.&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;NOTE&lt;/span&gt;: As of this writing, MySQL 5.0.51a and 5.1.23rc have bugs that prevent simple installation onto Vista. A &lt;a href=&quot;http://forums.mysql.com/read.php?11,195569,195569&quot;&gt;workaround recipe is available&lt;/a&gt; but it is complicated. We recommend using a &lt;a href=&quot;http://downloads.mysql.com/archives.php?p=mysql-5.0&amp;amp;v=5.0.45&quot;&gt;slightly older version, MySQL 5.0.45&lt;/a&gt;, as it doesn&amp;#8217;t have the current installation bugs. We&amp;#8217;ll update these instructions once fixes to the current MySQL line are available.&lt;/p&gt;
&lt;p&gt;Unfortunately, the MySQL installer and Windows Vista User Account Control (&lt;span class=&quot;caps&quot;&gt;UAC&lt;/span&gt;) conflict with one-another. You will have to temporarily turn &lt;span class=&quot;caps&quot;&gt;UAC&lt;/span&gt; off.&lt;/p&gt;
&lt;p&gt;First, go to the &lt;code&gt;Start Menu&lt;/code&gt;, select &lt;code&gt;Control Panel&lt;/code&gt;, and then click on &lt;code&gt;User Accounts and Family Safety&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/installwinvista_uac1.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Click on the &lt;code&gt;User Accounts&lt;/code&gt; link to open your account&amp;#8217;s setting dialog:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/installwinvista_uac2.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Click on the &lt;code&gt;Turn User Account Control on or off&lt;/code&gt; link. Assuming that User Account Control is still on, Windows Vista will ask for permission to continue with turning User Account Control off. Nice and circular, yes? Now you can actually turn &lt;span class=&quot;caps&quot;&gt;UAC&lt;/span&gt; off. Unselect the checkbox and press OK.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/installwinvista_uac3.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;You will be prompted to restart your computer. Go ahead and do so now.&lt;/p&gt;
&lt;p&gt;One other change you will need to make is to open your Windows Vista Firewall to permit MySQL connections to the MySQL server port (3306). To do so, open &lt;code&gt;Control Panel&lt;/code&gt; again, and select the &lt;code&gt;Allow a program through Windows Firewall&lt;/code&gt; option of the Security group.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/installwinvista_fw1.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Press the &lt;code&gt;Add port...&lt;/code&gt; button, and enter &lt;code&gt;MySQL&lt;/code&gt; in the &amp;#8220;Name:&amp;#8221; field and &lt;code&gt;3306&lt;/code&gt; in the &amp;#8220;Port number:&amp;#8221; field. Leave the protocol as &amp;#8220;&lt;span class=&quot;caps&quot;&gt;TCP&lt;/span&gt;&amp;#8221;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/installwinvista_fw2.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Press OK on the Windows Firewall Settings dialog box and close the Control Panel.&lt;/p&gt;
&lt;p&gt;Finally, you can get on with installing MySQL. Double-click the community edition (open source) Windows Essentials MySQL setup program to get started:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/installwinvista_mysql_1.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Select the default (&amp;#8220;Typical&amp;#8221;) settings and location and let the program install itself. After it completes, a few ads will be shown, then a final dialog allowing you to configure the MySQL server. Make sure the check-box is selected and press &amp;#8220;Finish&amp;#8221;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/installwinvista_mysql_2.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The &amp;#8220;MySQL Server Instance Configuration Wizard&amp;#8221; will run next. Choose the &amp;#8220;Detailed Configuration&amp;#8221; option and select all of the default choices. Doing so will configure the database to be running with settings best designed for a developer&amp;#8217;s computer. When you get to the dialog offering the &amp;#8220;Include Bin Directory in Windows &lt;span class=&quot;caps&quot;&gt;PATH&lt;/span&gt;&amp;#8221; option, we suggest you select it. If you don&amp;#8217;t choose this option, you will need to manually set up your path so the &amp;#8220;Command Prompt&amp;#8221; program has easy access to MySQL client programs.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/installwinvista_mysql_3.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;You will also be presented with a dialog to set a root password. If you are going to be working locally and aren&amp;#8217;t worried about security, you can deselect &amp;#8220;Modify Security Settings&amp;#8221; and have a blank root password. We strongly suggest you set a password to be safe.&lt;/p&gt;
&lt;p&gt;You can confirm that MySQL is running by trying to fire it up in the Command Prompt program:&lt;/p&gt;
&lt;pre&gt;
	C:\&amp;gt; mysql -p -u root
	Enter password: ****
	Welcome to the MySQL monitor.  Commands end with ; or \g.
	Your MySQL connection id is 1
	Server version: 5.0.45-community-nt MySQL Community Edition (GPL)

	Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

	mysql&amp;gt; exit
&lt;/pre&gt;
&lt;p&gt;When you reboot your computer, MySQL will start automatically in the future.&lt;/p&gt;
&lt;p&gt;Once you have confirmed MySQL is working, you can also reverse the steps above for re-enabling User Account Control.&lt;/p&gt;
&lt;h3&gt;Gems&lt;/h3&gt;
&lt;p&gt;While the One-Click Ruby installer added some common Windows oriented gems for you, you still need the Ruby on Rails gems and the gems used in the LearningRails course. Install them with the command:&lt;/p&gt;
&lt;pre&gt;
	C:\&amp;gt; gem install rails capistrano mongrel mongrel_cluster
&lt;/pre&gt;
&lt;p&gt;All installed gems (including Ruby on Rails and its dependencies, Capistrano, Mongrel, and Mongrel_Cluster) will get installed at their latest versions.&lt;/p&gt;
&lt;p&gt;The MySQL adapter gem needs to be installed next.&lt;/p&gt;
&lt;pre&gt;
	C:\&amp;gt; gem install mysql
&lt;/pre&gt;
&lt;p&gt;Once the command completes, you should be all set with the baseline gems you will need for the LearningRails courses.&lt;/p&gt;
&lt;h3&gt;&lt;span class=&quot;caps&quot;&gt;SSH&lt;/span&gt; Terminal Program&lt;/h3&gt;
&lt;p&gt;In deployment environments where your production or other remote servers are running a Unix-derived operating system, you will want to log in to those machines using the &lt;span class=&quot;caps&quot;&gt;SSH&lt;/span&gt; protocol. A good Windows &lt;span class=&quot;caps&quot;&gt;SSH&lt;/span&gt; terminal program is &lt;a href=&quot;http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html&quot;&gt;PuTTY&lt;/a&gt;. Download the complete Windows installer and double click to let it run.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/installwinvista_putty.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;You can select all of the default options. Once the installer finishes, you are good to login to your remote machines.&lt;/p&gt;
&lt;h3&gt;Installing a Git client&lt;/h3&gt;
&lt;p&gt;Git is all the rage in the Rails world now and has pretty much replaced Subversion as the version control system of choice. That said, both are in common use. The &lt;a href=&quot;http://code.google.com/p/msysgit/&quot;&gt;Git on MSys&lt;/a&gt; project team has done a nice job of building the git tools and a simple installer for Windows.&lt;/p&gt;
&lt;p&gt;Download the latest installer (latest as of the last update of this article was &lt;a href=&quot;http://msysgit.googlecode.com/files/Git-1.5.6.1-preview20080701.exe&quot;&gt;Git-1.5.6.1-preview20080701.exe&lt;/a&gt;) and double click the executable.&lt;/p&gt;
&lt;p&gt;During setup, you will be presented with a number of screens. Select the defaults until you get to the following two dialogs:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;&lt;strong&gt;&amp;#8220;Adjust your &lt;span class=&quot;caps&quot;&gt;PATH&lt;/span&gt; environment&amp;#8221;&lt;/strong&gt; dialog. Select the &lt;em&gt;&amp;#8220;Run Git from the Windows Command Prompt&amp;#8221;&lt;/em&gt;.&lt;/li&gt;
	&lt;li&gt;&lt;strong&gt;&amp;#8220;Choosing the &lt;span class=&quot;caps&quot;&gt;SSH&lt;/span&gt; executable&amp;#8221;&lt;/strong&gt; dialog. Select &lt;em&gt;&amp;#8220;Use PLink&amp;#8221;&lt;/em&gt; since we just installed Putty.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The installer should complete, and you can optionally review the ReleaseNotes.rtf file.&lt;/p&gt;
&lt;p&gt;The installer command places the core git tools and the man page documentation (type &lt;code&gt;git help _commandname_&lt;/code&gt; for help) on your machine and updates the &lt;span class=&quot;caps&quot;&gt;PATH&lt;/span&gt; so you can use git from the Command Prompt. &lt;code&gt;ruby script\plugin install&lt;/code&gt; should find git and use it for installation of newer plugins.&lt;/p&gt;
&lt;p&gt;Note that if you have an older Rails project, you&amp;#8217;ll want to update to Rails 2.1 or newer to get the latest support for git. When you upgrade, update your project with the &lt;code&gt;rake rails:update&lt;/code&gt; command.&lt;/p&gt;
&lt;h3&gt;Code Editing Tools&lt;/h3&gt;
&lt;p&gt;While you can get by with using a plain text editor like Notepad you will have much high productivity if you use a programming editor that is highly tuned to Ruby on Rails development. The One-Click Ruby installer automatically installed the SciTE programmer&amp;#8217;s editor. SciTE is ok for basic tasks with one or two files, but we recommend trying some of the other programs below.&lt;/p&gt;
&lt;p&gt;We use the commercial &lt;a href=&quot;http://macromates.com/&quot;&gt;TextMate&lt;/a&gt; programmer&amp;#8217;s editor for much of our day to day work on the Macintosh. TextMate is highly extensible through a collection of community supplied &amp;#8220;bundles&amp;#8221;. There is a Windows &amp;#8220;look-a-like/port&amp;#8221; called the &lt;a href=&quot;http://e-texteditor.com/&quot;&gt;E Text Editor&lt;/a&gt; that looks promising and includes much of the functionality found on the Mac. Even better, it is supposed to be compatible with TextMate bundles, so as functionality improves for one platform, it should become available on the other. Worth trying the trial at the least.&lt;/p&gt;
&lt;p&gt;There are a variety of good open source or free programmer editors available too. On the open source side you can find ports of vim and emacs, both of which have add-ons to create a full featured Ruby and Rails development tool set. &lt;a href=&quot;http://www.jedit.org/&quot;&gt;jEdit&lt;/a&gt; is a very extensible open source editor written in Java that has a decent Ruby programming plugin set.&lt;/p&gt;
&lt;p&gt;Whatever editor you choose, be certain that it provides easy navigation among a large number of open files. Working with Rails applications generally involves dealing with a lot of small files, and that process needs to be efficient.&lt;/p&gt;
&lt;p&gt;If you prefer an all-in-one tool, you should look at one of several integrated development environments that exist for Ruby. We use &lt;a href=&quot;http://www.netbeans.org/&quot;&gt;Netbeans&lt;/a&gt; in our LearningRails courses, but you should check out the numerous &lt;a href=&quot;http://www.buildingwebapps.com/topic/26-integrated-development-environments-ides&quot;&gt;other options listed at BuildingWebApps.com&lt;/a&gt;.&lt;/p&gt;</body>
  <created-at type="datetime">2008-07-24T01:00:48-07:00</created-at>
  <created-by type="integer">2</created-by>
  <dy-schema-id type="integer" nil="true"></dy-schema-id>
  <dy-schema-type nil="true"></dy-schema-type>
  <filter-id nil="true"></filter-id>
  <flags type="integer">1</flags>
  <historic-id type="integer">20</historic-id>
  <id type="integer">6491</id>
  <kind-id type="integer">5019</kind-id>
  <lock-version type="integer">4</lock-version>
  <name>Setting up Rails on Windows Vista</name>
  <owner-id type="integer" nil="true"></owner-id>
  <owner-type nil="true"></owner-type>
  <published-at type="datetime">2008-04-22T17:00:00-07:00</published-at>
  <rating type="integer">5</rating>
  <ref-count type="integer">0</ref-count>
  <sequence type="integer">0</sequence>
  <status type="integer">0</status>
  <updated-at type="datetime">2009-04-03T13:17:00-07:00</updated-at>
  <updated-by type="integer">2</updated-by>
  <url nil="true"></url>
  <user-id type="integer">2</user-id>
  <version type="integer">6</version>
  <workflow-task-status-id type="integer" nil="true"></workflow-task-status-id>
</article-node>
