<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>hotgazpacho &#187; rails</title>
	<atom:link href="http://hotgazpacho.org/category/ruby/rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://hotgazpacho.org</link>
	<description>Embrace! Embrace! You hippie coder! Get off my dynamic lawn!</description>
	<lastBuildDate>Sat, 10 Jul 2010 15:22:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Setting up Ubuntu 9.10 for Ruby and Rails Development in VirtualBox on Windows</title>
		<link>http://hotgazpacho.org/2010/01/setting-up-ubuntu-9-10-for-ruby-and-rails-development-in-virtualbox-on-windows/</link>
		<comments>http://hotgazpacho.org/2010/01/setting-up-ubuntu-9-10-for-ruby-and-rails-development-in-virtualbox-on-windows/#comments</comments>
		<pubDate>Sun, 03 Jan 2010 03:37:56 +0000</pubDate>
		<dc:creator>Will</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[VirtualBox]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ruby rails development vm linux]]></category>

		<guid isPermaLink="false">http://hotgazpacho.org/2010/01/setting-up-ubuntu-9-10-for-ruby-and-rails-development-in-virtualbox-on-windows/</guid>
		<description><![CDATA[I now believe that if you&#8217;re serious about creating Rails apps, you aren&#8217;t doing it on Windows. Or, you are a masochist. That’s a quote from me. I’m done trying to do serious Ruby &#38; Rails development on Windows. As of January 1st, 2010, I have not found a Ruby implementation on Windows that is [...]]]></description>
			<content:encoded><![CDATA[<blockquote cite="http://twitter.com/hotgazpacho/status/7283089460"><p>I now believe that if you&#8217;re serious about creating Rails apps, you aren&#8217;t doing it on Windows. Or, you are a masochist.</p>
</blockquote>
<p>That’s a quote from me. I’m done trying to do serious Ruby &amp; Rails development on Windows. As of January 1st, 2010, I have not found a Ruby implementation on Windows that is fast enough to support the TDD/BDD workflow that <a href="http://www.coreyhaines.com/">Corey Haines</a> exhibits in his <a href="http://katas.softwarecraftsmanship.org/?p=12">Number to LCD code kata</a>. On top of that, I wasted 2 days on trying to get <a href="http://seleniumhq.org/">Selenium</a> and <a href="http://cukes.info">Cucumber</a> to work together in Windows. I was venting about this on Twitter when <a href="http://www.coryfoy.com/">Cory Foy</a> made a suggestion:</p>
<blockquote cite="http://twitter.com/cory_foy/status/7270114092"><p>@<a href="http://twitter.com/hotgazpacho">hotgazpacho</a> You know, I don&#8217;t know why you don&#8217;t just run a VM with Linux on it for Rails dev. That&#8217;s what I have on my Windows box.</p>
</blockquote>
<p>I didn’t know why either. My first concern was memory consumption (my personal notebook only has 2 GB of RAM in it), but both Cory and <a href="http://blog.adsdevshop.com/">Robert Dempsey</a> allayed my fears:</p>
<blockquote cite="http://twitter.com/cory_foy/status/7272468693"><p>@<a href="http://twitter.com/hotgazpacho">hotgazpacho</a> 2GB should be plenty. The Linux VM should only need 512. Would help to run the VM on an external drive if you&#8217;ve got one</p>
</blockquote>
<blockquote cite="http://twitter.com/rdempsey/status/7272539736"><p>@<a href="http://twitter.com/cory_foy">cory_foy</a> @<a href="http://twitter.com/hotgazpacho">hotgazpacho</a> I run linux ubuntu vm&#8217;s (vmware) on my MBP and 512 is more than enough if you don&#8217;t use a heavy IDE. Runs very well</p>
</blockquote>
<p>So, I went ahead and set up <a href="http://www.ubuntu.com/">Ubuntu</a> 9.10 in a <a href="http://www.virtualbox.org/">VirtualBox</a> virtual machine (VirtualBox is a free virtualization product from Sun, similar to VMWare Workstation or Microsoft Virtual PC). The results were astounding! On a Rails app I was working on, all the RSpec examples and Cucumber features ran in less than the time it took for the MingW Ruby interpreter to start up. WOW! We’re talking orders of magnitude faster, and all in less memory than it takes to boot Windows. I’m sold.</p>
<h3>Here’s how I set up the VM:</h3>
<ol>
<li>Install VirtualBox </li>
<li>Create a new VB VM for Ubuntu      <br />The <a href="https://help.ubuntu.com/community/VirtualBox/FirstVM">Ubuntu Community wiki</a> has pretty good documentation (for Ubuntu host, but UI is pretty much identical on Windows) </li>
<li>Make sure the system is up-to-date <em>(it won&#8217;t be)</em>. Let update manager run &amp; reboot </li>
<li>Install Virtual Box additions &amp; reboot </li>
<li>Install pre-requirements for building stuff <em>(note: I may be missing some stuff. If I am, Ruby Enterprise Edition installer will let you know and tell you what is missing)</em>:
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> build-essential libpcre3 libxml2-dev libxslt1-dev sqlite3 libsqlite3-dev –y</div></td></tr></tbody></table></div>
</li>
<li><a href="http://www.rubyenterpriseedition.com/download.html">Ruby Enterprise Edition</a> <em>(cause this is what I run on my production server)</em>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">wget</span> <span style="color: #660033;">-c</span> http:<span style="color: #000000; font-weight: bold;">//</span>rubyforge.org<span style="color: #000000; font-weight: bold;">/</span>frs<span style="color: #000000; font-weight: bold;">/</span>download.php<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">66162</span><span style="color: #000000; font-weight: bold;">/</span>ruby-enterprise-1.8.7-<span style="color: #000000;">2009.10</span>.tar.gz &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000; font-weight: bold;">&lt;</span>br <span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #c20cb9; font-weight: bold;">tar</span> xzvf ruby-enterprise-1.8.7-<span style="color: #000000;">2009.10</span>.tar.gz &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;</span>br <span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #c20cb9; font-weight: bold;">sudo</span> .<span style="color: #000000; font-weight: bold;">/</span>ruby-enterprise-1.8.7-<span style="color: #000000;">2009.10</span><span style="color: #000000; font-weight: bold;">/</span>installer</div></td></tr></tbody></table></div>
<p></li>
<li>Add Ruby Enterprise Edition bin path to &quot;secure path&quot; for sudo
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">sudo</span> visudo</div></td></tr></tbody></table></div>
<p>Change line starting with Defaults to the following:       </p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Defaults env_reset, secure_path=/opt/ruby-enterprise-1.8.7-2009.10/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin</div></td></tr></tbody></table></div>
</li>
<li>Install <a href="http://github.com/lexrupy/gmate">gmate</a>, which makes gEdit behave like TextMate. Instructions are on the gmate github page.       </li>
<li>Make gem <em>not</em> install rdoc and ri by default.
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;gem: --no-rdoc --no-ri&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> ~<span style="color: #000000; font-weight: bold;">/</span>.gemrc</div></td></tr></tbody></table></div>
</li>
<li>Install Rails, Sqlite, ZenTest, RSpec, Cucumber, &amp; Factory Girl
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">sudo</span> gem i rails sqlite3-ruby ZenTest rspec cucumber factory_girl</div></td></tr></tbody></table></div>
</li>
<li>Make cucumber feature running part of autospec runs
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;export AUTOFEATURE=true&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> ~<span style="color: #000000; font-weight: bold;">/</span>.profile</div></td></tr></tbody></table></div>
</li>
</ol>
<h3>One Minor Problem…</h3>
<p>There’s only one minor problem with this whole setup. Cory Foy articulated it best:</p>
<blockquote cite="http://twitter.com/cory_foy/status/7279949479"><p>@<a href="http://twitter.com/hotgazpacho">hotgazpacho</a> The problem is now you&#8217;ll /really/ not be happy doing Rails on Windows. Ever. <img src='http://hotgazpacho.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
</blockquote>
<p>This is a problem I can live with <img src='http://hotgazpacho.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h3>For some additional fun…</h3>
<p>…you might want to install the following:</p>
<ol>
<li><a href="http://github.com/lvv/git-prompt">git-prompt</a>, bash prompt with GIT, SVN and HG modules       </p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">git</span> clone <span style="color: #c20cb9; font-weight: bold;">git</span>:<span style="color: #000000; font-weight: bold;">//</span>github.com<span style="color: #000000; font-weight: bold;">/</span>lvv<span style="color: #000000; font-weight: bold;">/</span>git-prompt.git <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;. ~/git-prompt/git-prompt.sh&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> ~<span style="color: #000000; font-weight: bold;">/</span>.profile</div></td></tr></tbody></table></div>
</li>
<li>Autotest/Autospec notifications to Ubuntu system notifications <em>(similar to Growl on OS X)</em>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">sudo</span> gem i test_notifier <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;require 'test_notifier/autotest'&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> ~<span style="color: #000000; font-weight: bold;">/</span>.autotest</div></td></tr></tbody></table></div>
</li>
<li>Sounds for Autotest events &#8211; <a href="http://www.fozworks.com/2007/7/28/autotest-sound-effects">http://www.fozworks.com/2007/7/28/autotest-sound-effects</a>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> mpg321 <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">wget</span> <span style="color: #660033;">-c</span> http:<span style="color: #000000; font-weight: bold;">//</span>www.fozworks.com<span style="color: #000000; font-weight: bold;">/</span>static<span style="color: #000000; font-weight: bold;">/</span>autotest-sound-<span style="color: #000000;">1</span>_2.zip <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">gunzip</span> autotest-sound-<span style="color: #000000;">1</span>_2.zip <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;require '~/autotest/sound/sound.rb'&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> ~<span style="color: #000000; font-weight: bold;">/</span>.autotest <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Autotest::Sound.sound_path = '~/autotest/sound/sound_fx/'&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> ~<span style="color: #000000; font-weight: bold;">/</span>.autotest</div></td></tr></tbody></table></div>
</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://hotgazpacho.org/2010/01/setting-up-ubuntu-9-10-for-ruby-and-rails-development-in-virtualbox-on-windows/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Rails 2.3.0 + IIS7 + FastCGI = Rails on Windows FTW!</title>
		<link>http://hotgazpacho.org/2009/02/rails-230-iis7-fastcgi-rails-on-windows-ftw/</link>
		<comments>http://hotgazpacho.org/2009/02/rails-230-iis7-fastcgi-rails-on-windows-ftw/#comments</comments>
		<pubDate>Sun, 08 Feb 2009 05:01:22 +0000</pubDate>
		<dc:creator>Will</dc:creator>
				<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[FastCGI]]></category>
		<category><![CDATA[IIS]]></category>
		<category><![CDATA[IIS7]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://hotgazpacho.org/2009/02/rails-230-iis7-fastcgi-rails-on-windows-ftw/</guid>
		<description><![CDATA[I love Rails, and I run Windows. There, I said it. I know many Railers scoff at us, mock us, etc. Whatever. I run Windows (Vista, specifically). I’m a Microsoft.Net Web Developer at my day job. My company has invested heavily in the Microsoft platform. I don’t like WebForms (why is a topic for another [...]]]></description>
			<content:encoded><![CDATA[<p><strong>I love Rails, and I run Windows.</strong></p>
<p>There, I said it. I know many Railers scoff at us, mock us, etc. Whatever. I run Windows (Vista, specifically). I’m a Microsoft.Net Web Developer at my day job. My company has invested heavily in the Microsoft platform. I don’t like WebForms (why is a topic for another post), and, because of Rails, I know there is a better way to do web development. Yes, I know about <a href="http://www.asp.net/mvc/">ASP.Net MVC</a>, but I have yet to try it. What I have tried is Rails, and I know that a Microsoft stack is the way to get it into my day-to-day work.</p>
<p>So, a couple of days ago, with <a href="http://weblog.rubyonrails.org/2009/2/1/rails-2-3-0-rc1-templates-engines-rack-metal-much-more">the announcement of Rails 2.3.0 rc1</a> I decided to see if I could get the latest Rails running under IIS 7 on my Vista notebook. I tried to find directions on how to accomplish this, but none were very straight forward. So, I’ve decided to document the process here for myself and other WinRailers.</p>
<p><span id="more-9"></span></p>
<p><em><strong>Note:</strong> 2.3.0 rc1 will not work, due to </em><a href="http://rails.lighthouseapp.com/projects/8994/tickets/1854-fastcgi-dispatcher-dont-work"><em>this bug in Rails&#8217; FastCGI handler</em></a><em>. Fortunately, this was fixed and merged into the rails source. You will need the 2.3.0 gem installed, though, to generate a 2.3 Rails app. I’ll go into details below.</em></p>
<h3>First, Credit where Credit is Due</h3>
<p>I can’t take all the credit for this. The following two articles helped to guide my down my path:</p>
<ul>
<li><a href="http://mvolo.com/blogs/serverside/archive/2007/02/18/10-steps-to-get-Ruby-on-Rails-running-on-Windows-with-IIS-FastCGI.aspx">10 steps to get Ruby on Rails running on Windows with IIS FastCGI</a></li>
<li><a href="http://ruslany.net/2008/08/ruby-on-rails-in-iis-70-with-url-rewriter/">Ruby on Rails in IIS 7.0 with URL Rewriter</a></li>
</ul>
<h3>Software You’ll Need</h3>
<ul>
<li>IIS 7 <em>(Windows Server 2008, or any version of Vista SP1 that has IIS)</em></li>
<li><a href="http://www.microsoft.com/web/channel/products/WebPlatformInstaller.aspx">The Microsoft Web Platform Installer</a></li>
<li><a href="http://rubyforge.org/frs/shownotes.php?release_id=17128">Ruby One-Click Installer 1.8.6-26 Final Release</a></li>
<li><a href="http://code.google.com/p/msysgit/">msysgit</a></li>
<li><a href="http://sqlite.org/" target="_blank">SQLite3</a></li>
</ul>
<h3>The Steps You’ll Take</h3>
<ol>
<li>Enable FastCGI support in IIS7</li>
<li>Install URL Rewrite module</li>
<li>Install Ruby</li>
<li>Install msysgit</li>
<li>“Install” SQLite</li>
<li>Update Rubygems</li>
<li>(gem) Install Rails</li>
<li>Create a Rails app</li>
<li>Grab the latest Rails 2.3 from github</li>
<li>web.config</li>
<li>Setup up web site in IIS</li>
</ol>
<h4>1 &#8211; Enable FastCGI support in IIS7</h4>
<p>IIS7 supports FastCGI natively now. You just need to make sure you install CGI support. It was not obvious to me that this was needed. I was looking for a FastCGI option, but it is listed as plain old CGI. <a href="http://learn.iis.net/page.aspx/246/using-fastcgi-to-host-php-applications-on-iis-70/#EnableFastCGI" target="_blank">Microsoft has good directions</a> on how to accomplish this task on their site, so I will not rehash them here.</p>
<h4>2 &#8211; Install URL Rewrite Module</h4>
<p>The easiest way to get this (and keep it updated!) is to use the Web Platform Installer. It might also want to install updated FastCGI support. I let this happen with no ill effects. So, go ahead a check “URL Rewrite” in the installer and go to town.</p>
<h4>3 &#8211; Install Ruby</h4>
<p><a href="http://blog.mmediasys.com/" target="_blank">Luis Lavena</a> has done an awesome job of maintaining the Ruby One Click Installer for Windows. Of particular importance to my little endeavor is that, in the <strong>One-Click Ruby Installer 1.8.6-26 Final Release</strong>, Luis included ruby-fcgi and the FastCGI C extension. Thanks, Luis! You can safely run the installer and click “Next” all the way through.</p>
<h4>4 &#8211; Install msysgit</h4>
<p>Rails developers use git. You need get to pull the latest source, which includes the FastCGI fix I aluded to above. msysgit is your best option. You can safely run the installer and click “Next” all the way through.</p>
<h4>5 &#8211; “Install” SQLite</h4>
<p>I use quotes around install because you don’t really install anything. You simply unzip the sqlite-3_6_10.zip file into any folder in your path. Personally, I create a folder,</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">C:\bin</div></td></tr></tbody></table></div>
<p>, add that to my path, and unzip the files there. I keep other things here, too, like wget.</p>
<h4>6 &#8211; Update Rubygems</h4>
<p>The version packaged in the OCI is old. Save yourself trouble, open up a command prompt, and:</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">gem up --system</div></td></tr></tbody></table></div>
<h4>7 &#8211; (gem) install Rails</h4>
<p>You need to have Rails installed. Rails 2.3.0 rc1 has some undeclared dependencies. So, first:</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">gem install test-spec rack</div></td></tr></tbody></table></div>
<p>Next,</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">gem install rails --source &lt;a href=&quot;http://gems.rubyonrails.org&quot;&gt;http://gems.rubyonrails.org&lt;/a&gt;</div></td></tr></tbody></table></div>
<h4>8 &#8211; Create a Rails app</h4>
<p>Most of my code goes into the following folder: C:\Development. Assuming this directory does not exist:</p>
<ol>
<li>Open a command prompt</li>
<li>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">c:</div></td></tr></tbody></table></div>
</li>
<li>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">cd \</div></td></tr></tbody></table></div>
</li>
<li>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">mkdir Development</div></td></tr></tbody></table></div>
</li>
<li>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">cd Development</div></td></tr></tbody></table></div>
</li>
<li>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">rails myapp</div></td></tr></tbody></table></div>
</li>
</ol>
<h4>9 &#8211; Grab the latest Rails from github</h4>
<p>This is where msysgit comes in. Fire up Git Bash, and:</p>
<ol>
<li>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">cd /c/Development/myapp/vendor</div></td></tr></tbody></table></div>
</li>
<li>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">git clone git://github.com/rails/rails.git</div></td></tr></tbody></table></div>
</li>
</ol>
<h4>10 – web.config</h4>
<p>The IIS team, under <a href="http://weblogs.asp.net/scottgu/" target="_blank">Scott Guthrie</a> <em>(also oversees ASP.Net, particularly ASP.Net MVC)</em>, have done some awesome stuff in the last couple years. They have turned IIS 7 into, in the words of <a href="http://www.coreyhaines.com/" target="_blank">Software Journeyman Corey Haines</a>, “A respectable web server”. I agree. IIS 7 is a lot more like Apache than it ever used to be, and I think this is a good thing.</p>
<p>One of the nice things is that you can now move a bunch of your web server configuration into a web.config file in your application. That means you can add it to version control <img src='http://hotgazpacho.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>ASP.Net programmers will be intimately familiar with this file. Everyone else can think of this file as the equivalent of Apache’s .htaccess files. In our case, we’ll use the following web.config to configure both the FastCGI handler <em>and</em> the URL Rewrite rules:</p>
<pre lang="xml">&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;rule name="Rewrite app_offline.html if file exists" stopProcessing="true"&gt;
  &lt;match url="^.*$" ignoreCase="false" /&gt;
  &lt;conditions&gt;
    &lt;add input="{DOCUMENT_ROOT}/app_offline.html" matchType="IsFile" ignoreCase="false" /&gt;
    &lt;add input="{SCRIPT_FILENAME}" pattern="app_offline.html" ignoreCase="false" negate="true" /&gt;
    &lt;add input="{SCRIPT_FILENAME}" pattern="^(.+).(png|gif|jpg|css|js)$" ignoreCase="false" negate="true" /&gt;
  &lt;/conditions&gt;
  &lt;action type="Rewrite" url="/app_offline.html" /&gt;
&lt;/rule&gt;</pre>
<p>So, let me explain what is going on here. First, the handlers section. This is where we set it up so that the FastCGI handler will process requests for dispatch.fcgi with the ruby interpreter, and run myapp in development mode. To run in production, simply replace <em>development</em> with <em>production</em>.</p>
<p>The next section is the URL Rewrite section. As you can see, it is much more, um, <em>expressive</em> than Apache’s syntax. Anyway, another cool thing Microsoft has done with IIS7 and the URL Rewrite module is an Import function. This allows you to import your existing mod_rewrite rules into their format. Cool! So, that’s what I did. I took some existing mod_rewrite rules for FastCGI, and popped it in to the UI to get the markup above.</p>
<p>You’ll notice a section that is commented out. That is an attempt to get the app_offline.html file working. That is, if the file exists, your app is in maintenance mode, and all requests for any Rails route should instead have this served up. I wasn’t able to get this working. Perhaps someone can take a look at it with fresh eyes.</p>
<h4>11 – Set up web site in IIS</h4>
<p>This one is crazy simple. Create a new website, with the physical path set to the public directory of your Rails app. So, in our case, that would be:</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">C:\Development\myapp\public</div></td></tr></tbody></table></div>
<p>There is one more thing that I do, but I don’t know if it necessary. For the Application Pool that was created for this site, I change the “.Net Framework Version” to “No Managed Code”. The Rails app is not a .Net app, so I see no reason to turn on managed code for this app.</p>
<p><a href="http://hotgazpacho.org/wp-content/uploads/2009/02/rails2-3-0iis7apppool.png"><img style="display: inline; border-width: 0px;" title="Rails-2_3_0-IIS7-AppPool" src="http://hotgazpacho.org/wp-content/uploads/2009/02/rails2-3-0iis7apppool-thumb.png" border="0" alt="Rails-2_3_0-IIS7-AppPool" width="644" height="377" /></a></p>
<p>That&#8217;s about it! No, seriously. It is that easy. Don’t believe me? Open up a web browser and go to the web site you created (localhost for me). Click on “<a href="http://localhost/rails/info/properties">About your application’s environment</a>”, wait a bit for the FastCGI process to spin up, and voila:</p>
<p><a href="http://hotgazpacho.org/wp-content/uploads/2009/02/rails2-3-0iis7.png"><img style="display: inline; border-width: 0px;" title="Rails-2_3_0-IIS7" src="http://hotgazpacho.org/wp-content/uploads/2009/02/rails2-3-0iis7-thumb.png" border="0" alt="Rails-2_3_0-IIS7" width="660" height="461" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://hotgazpacho.org/2009/02/rails-230-iis7-fastcgi-rails-on-windows-ftw/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
