<?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; ruby</title>
	<atom:link href="http://hotgazpacho.org/tag/ruby/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>Iron Languages Podcast &#8211; Episode I: We Have Lift-off</title>
		<link>http://hotgazpacho.org/2010/06/iron-languages-podcast-episode-i-we-have-lift-off/</link>
		<comments>http://hotgazpacho.org/2010/06/iron-languages-podcast-episode-i-we-have-lift-off/#comments</comments>
		<pubDate>Thu, 24 Jun 2010 16:33:32 +0000</pubDate>
		<dc:creator>Will</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ironruby]]></category>
		<category><![CDATA[podcast]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ironlanguages]]></category>

		<guid isPermaLink="false">http://hotgazpacho.org/?p=120</guid>
		<description><![CDATA[Mike Hall and I have finally gotten together and recorded our first episode of The Iron Languages Podcast. In this episode, we chat about the Dynamic Language Runtime (DLR) and IronRuby in particular. Some links related to topics we discussed: Iron Ruby : http://ironruby.net Dynamic Language Runtime (DLR):http://en.wikipedia.org/wiki/Dynamic_Language_Runtime Factory Girl: http://github.com/thoughtbot/factory_girl Sinatra: http://sinatrarb.com Jython: http://www.jython.org RailsMentor.org: http://railsmentor.org Please let us [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://ww.ironlanguages.net/"><img class="alignleft" title="The Iron Languages Podcast" src="http://hotgazpacho.org/wp-content/uploads/2010/07/Fe.png" alt="" width="150" height="150" /></a></p>
<p><a href="http://www.just3ws.com">Mike Hall</a> and I have finally gotten together and recorded our<a href="http://ironlanguages.posterous.com/episode-i-we-have-lift-off"> first episode of The Iron Languages Podcast</a>.</p>
<p>In this episode, we chat about the Dynamic Language Runtime (DLR) and IronRuby in particular.</p>
<p>Some links related to topics we discussed:</p>
<ul>
<li>Iron Ruby : <a href="http://ironruby.net/" target="_blank">http://ironruby.net</a></li>
<li>Dynamic Language Runtime (DLR):<a href="http://en.wikipedia.org/wiki/Dynamic_Language_Runtime" target="_blank">http://en.wikipedia.org/wiki/Dynamic_Language_Runtime</a></li>
<li>Factory Girl: <a href="http://github.com/thoughtbot/factory_girl" target="_blank">http://github.com/thoughtbot/factory_girl</a></li>
<li>Sinatra: <a href="http://sinatrarb.com/" target="_blank">http://sinatrarb.com</a></li>
<li>Jython: <a href="http://www.jython.org/" target="_blank">http://www.jython.org</a></li>
<li>RailsMentor.org: <a href="http://railsmentor.org/" target="_blank">http://railsmentor.org</a></li>
</ul>
<p>Please let us know what you think, how we can improve and what you&#8217;d like to hear about. We hope you enjoy the podcast!</p>
]]></content:encoded>
			<wfw:commentRss>http://hotgazpacho.org/2010/06/iron-languages-podcast-episode-i-we-have-lift-off/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IronRuby: `gem update &#8211;system`</title>
		<link>http://hotgazpacho.org/2010/05/ironruby-gem-update-system/</link>
		<comments>http://hotgazpacho.org/2010/05/ironruby-gem-update-system/#comments</comments>
		<pubDate>Tue, 18 May 2010 17:28:19 +0000</pubDate>
		<dc:creator>Will</dc:creator>
				<category><![CDATA[gems]]></category>
		<category><![CDATA[ironruby]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[rubygems]]></category>

		<guid isPermaLink="false">http://hotgazpacho.org/?p=106</guid>
		<description><![CDATA[After reading this article on getting around the invalid exec_format “ir”, no %s issue when trying to update RubyGems in IronRuby, I came up with a better solution (rather than essentially swallowing the exception) to the problem. Stick the following file in: %IronRubyInstallDir%\lib\ruby\site_ruby\1.8\rubygems\defaults\ironruby.rb 123456789101112module Gem &#160; def self.default_exec_format &#160; &#160; exec_format = ConfigMap&#91;:ruby_install_name&#93;.sub&#40;'ir', '%s'&#41; rescue [...]]]></description>
			<content:encoded><![CDATA[<p>After reading <a href="http://marcinobel.com/index.php/bug-invalid-exec_format-ir" target="_blank">this article</a> on getting around the <strong><em>invalid exec_format “ir”, no %s</em></strong> issue when trying to update RubyGems in IronRuby, I came up with a better solution (rather than essentially swallowing the exception) to the problem. Stick the following file in:<tt> %IronRubyInstallDir%\lib\ruby\site_ruby\1.8\rubygems\defaults\ironruby.rb</tt></p>
<div class="codecolorer-container ruby vibrant" style="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 />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br /></div></td><td><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color:#9966CC; font-weight:bold;">module</span> Gem<br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">def</span> <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">default_exec_format</span><br />
&nbsp; &nbsp; exec_format = ConfigMap<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:ruby_install_name</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#CC0066; font-weight:bold;">sub</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'ir'</span>, <span style="color:#996600;">'%s'</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">rescue</span> <span style="color:#996600;">'%s'</span><br />
<br />
&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">unless</span> exec_format =~ <span style="color:#006600; font-weight:bold;">/%</span>s<span style="color:#006600; font-weight:bold;">/</span> <span style="color:#9966CC; font-weight:bold;">then</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#CC0066; font-weight:bold;">raise</span> Gem::<span style="color:#CC00FF; font-weight:bold;">Exception</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#996600;">&quot;[BUG] invalid exec_format #{exec_format.inspect}, no %s&quot;</span><br />
&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
<br />
&nbsp; &nbsp; exec_format<br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
<span style="color:#9966CC; font-weight:bold;">end</span></div></td></tr></tbody></table></div>
<p>I&#8217;m working on getting this contributed to the IronRuby project, as judging from the RubyGems sources, as well as the RubyGems sources distributed with JRuby, this is intended to be distributed by the Ruby implementation, not RubyGems itself.</p>
<p>Also note, this allows one to:</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">ir -S gem install bundler</div></td></tr></tbody></table></div>
]]></content:encoded>
			<wfw:commentRss>http://hotgazpacho.org/2010/05/ironruby-gem-update-system/feed/</wfw:commentRss>
		<slash:comments>0</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>
