<?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/category/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>Using Factory Girl from C# with IronRuby for building .NET objects</title>
		<link>http://hotgazpacho.org/2010/06/using-factory-girl-from-c-with-ironruby-for-building-net-objects/</link>
		<comments>http://hotgazpacho.org/2010/06/using-factory-girl-from-c-with-ironruby-for-building-net-objects/#comments</comments>
		<pubDate>Wed, 09 Jun 2010 12:30:00 +0000</pubDate>
		<dc:creator>Will</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ironruby]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[factory girl]]></category>

		<guid isPermaLink="false">http://hotgazpacho.org/2010/06/using-factory-girl-from-c-with-ironruby-for-building-net-objects/</guid>
		<description><![CDATA[Recently at work, I’ve been using TDD to drive out the design for some WPF View Models. Part of what I’m doing is filtering a collection based on various properties of the elements in the collection. Of course, I’ve needed to build up that collection first. I’d come up with a very limited method using [...]]]></description>
			<content:encoded><![CDATA[<p>Recently at work, I’ve been using TDD to drive out the design for some WPF View Models. Part of what I’m doing is filtering a collection based on various properties of the elements in the collection. Of course, I’ve needed to build up that collection first. I’d come up with a very limited method using <a href="http://msdn.microsoft.com/en-us/library/018hxwa8.aspx" target="_blank">Action&lt;T&gt;</a> to set properties when the builder method was called. While this worked for my needs, I got to thinking about a library I’ve used a couple of times on Rails projects: <a href="http://github.com/thoughtbot/factory_girl" target="_blank">Factory Girl</a>. </p>
<p>On numerous occasions working with C# on .NET, I’ve thought to myself “man, I really wish I had something like Factory Girl here!”. So, last night/this morning, I set out to create a <a href="http://www.extremeprogramming.org/rules/spike.html" target="_blank">spike solution</a> to determine the feasibility of hosting IronRuby within my C# library, thus allowing me to use Factory Girl to build POCOs for me. The result:</p>
<p> <script src="http://gist.github.com/431058.js?file=gistfile1.cs"></script>
<p>OH YEAH! </p>
<p>Well, at least for the Factory.build method, but that’s all I was interested in for this spike.</p>
<p>I’ve put my code up on <a href="http://github.com/hotgazpacho/IronRubyFactoryGirlSpike" target="_blank">github</a> for your perusal. For this particular solution I don’t think you’ll need Visual Studio 2010, but you will certainly need .NET 4 installed, as well as IronRuby. Also note that IronRuby needs to be installed into C:\IronRuby unless you want to edit the app.config and fix up some references.</p>
<p>I’m excited now about the possibilities of utilizing other Ruby libraries in my .NET projects!</p>
]]></content:encoded>
			<wfw:commentRss>http://hotgazpacho.org/2010/06/using-factory-girl-from-c-with-ironruby-for-building-net-objects/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>I&#8217;m on Herding Code!</title>
		<link>http://hotgazpacho.org/2010/06/im-on-herding-code/</link>
		<comments>http://hotgazpacho.org/2010/06/im-on-herding-code/#comments</comments>
		<pubDate>Tue, 08 Jun 2010 18:16:25 +0000</pubDate>
		<dc:creator>Will</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[podcast]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://hotgazpacho.org/?p=114</guid>
		<description><![CDATA[Just a quicky here&#8230; A couple of weeks ago, Cory Foy and I had a chat with the Herding Code guys. We talked about the differences between developing on the .NET platform and in Ruby/Rails. It was a great time. Please go give it a listen, and do let me know what you think!]]></description>
			<content:encoded><![CDATA[<p>Just a quicky here&#8230;</p>
<p>A couple of weeks ago, <a href="http://blog.coryfoy.com/">Cory Foy</a> and I <a href="http://herdingcode.com/?p=254">had a chat with the Herding Code</a> guys. We talked about the differences between developing on the .NET platform and in Ruby/Rails. It was a great time. Please go give it a listen, and do let me know what you think!</p>
]]></content:encoded>
			<wfw:commentRss>http://hotgazpacho.org/2010/06/im-on-herding-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Presentation: IronRuby for the Rubyist</title>
		<link>http://hotgazpacho.org/2010/05/presentation-ironruby-for-the-rubyist/</link>
		<comments>http://hotgazpacho.org/2010/05/presentation-ironruby-for-the-rubyist/#comments</comments>
		<pubDate>Fri, 28 May 2010 16:56:39 +0000</pubDate>
		<dc:creator>Will</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ironruby]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://hotgazpacho.org/2010/05/presentation-ironruby-for-the-rubyist/</guid>
		<description><![CDATA[Last night, I gave a talk at the Tampa Ruby Brigade about IronRuby, targeted at the developer who already knows and loves Ruby. About 10 people turned out, including the regional Microsoft Developer Evangelist, Joe Healy&#160;(nice to see Microsoft reaching out to other development communities!). The crowd was predominantly Mac users, and I had some [...]]]></description>
			<content:encoded><![CDATA[<p>Last night, <a href="http://www.meetup.com/tampa-rb/calendar/13481809/" target="_blank">I gave a talk at the Tampa Ruby Brigade</a> about IronRuby, targeted at the developer who already knows and loves Ruby. About 10 people turned out, including the regional Microsoft Developer Evangelist, <a href="http://www.devfish.net/" target="_blank">Joe Healy</a>&#160;<em>(nice to see Microsoft reaching out to other development communities!)</em>. The crowd was predominantly Mac users, and I had some concerns that the talk might not be well received. Boy, was I worried over nothing! This quote about sums up the reaction:</p>
<blockquote cite="http://www.meetup.com/tampa-rb/calendar/13481809/"><p>I was interested in IronRuby when it was first announced but had lost hope that it would ever be viable. Will did an awesome job of convincing me that it&#8217;s alive and well. Great talk.</p>
<p>&#8211; Barry Ezell</p>
</blockquote>
<p>Nice! Below are the slides, and <a href="http://github.com/hotgazpacho/ironruby-for-rubyists" target="_blank">here are the (admittedly thin) demos up on Github.</a></p>
<div style="width: 425px" id="__ss_4343064"><strong style="margin: 12px 0px 4px; display: block"><a title="IronRuby for the Rubyist" href="http://www.slideshare.net/hotgazpacho/iron-ruby-for-the-rubyist">IronRuby for the Rubyist</a></strong><object id="__sse4343064" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=ironrubyfortherubyist-100528083539-phpapp01&amp;rel=0&amp;stripped_title=iron-ruby-for-the-rubyist" /><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><embed name="__sse4343064" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=ironrubyfortherubyist-100528083539-phpapp01&amp;rel=0&amp;stripped_title=iron-ruby-for-the-rubyist" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object>
<div style="padding-bottom: 12px; padding-left: 0px; padding-right: 0px; padding-top: 5px">View more <a href="http://www.slideshare.net/">presentations</a> from <a href="http://www.slideshare.net/hotgazpacho">Will Green</a>.</div>
</p></div>
]]></content:encoded>
			<wfw:commentRss>http://hotgazpacho.org/2010/05/presentation-ironruby-for-the-rubyist/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>My Patch to Ruby Gems for IronRuby support is in 1.3.7!</title>
		<link>http://hotgazpacho.org/2010/05/my-patch-to-ruby-gems-for-ironruby-support-is-in-1-3-7/</link>
		<comments>http://hotgazpacho.org/2010/05/my-patch-to-ruby-gems-for-ironruby-support-is-in-1-3-7/#comments</comments>
		<pubDate>Sat, 15 May 2010 04:24:34 +0000</pubDate>
		<dc:creator>Will</dc:creator>
				<category><![CDATA[gems]]></category>
		<category><![CDATA[ironruby]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://hotgazpacho.org/?p=101</guid>
		<description><![CDATA[I&#8217;m now a published contributor to a major open source project! C:\Users\Will&#62;gem up &#8211;system Updating RubyGems Updating rubygems-update Successfully installed rubygems-update-1.3.7 Updating RubyGems to 1.3.7 Installing RubyGems 1.3.7 RubyGems 1.3.7 installed ∩╗┐=== 1.3.7 / 2010-05-13 NOTE: http://rubygems.org is now the default source for downloading gems. You may have sources set via ~/.gemrc, so you should [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m now a published contributor to a major open source project!</p>
<p><span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; line-height: 18px; font-size: 12px; white-space: pre;">C:\Users\Will&gt;gem up &#8211;system</span></p>
<pre>Updating RubyGems
Updating rubygems-update
Successfully installed rubygems-update-1.3.7
Updating RubyGems to 1.3.7
Installing RubyGems 1.3.7
RubyGems 1.3.7 installed</pre>
<pre>∩╗┐=== 1.3.7 / 2010-05-13</pre>
<pre>NOTE:</pre>
<pre>http://rubygems.org is now the default source for downloading gems.</pre>
<pre>You may have sources set via ~/.gemrc, so you should replace
http://gems.rubyforge.org with http://rubygems.org</pre>
<pre>http://gems.rubyforge.org will continue to work for the forseeable future.</pre>
<pre>New features:</pre>
<pre>* `gem` commands
  * `gem install` and `gem fetch` now report alternate platforms when a
    matching one couldn't be found.
  * `gem contents` --prefix is now the default as specified in --help.  Bug
    #27211 by Mamoru Tasaka.
  * `gem fetch` can fetch of old versions again.  Bug #27960 by Eric Hankins.
  * `gem query` and friends output now lists platforms.  Bug #27856 by Greg
    Hazel.
  * `gem server` now allows specification of multiple gem dirs for
    documentation.  Bug #27573 by Yuki Sonoda.
  * `gem unpack` can unpack gems again.  Bug #27872 by Timothy Jones.
  * `gem unpack` now unpacks remote gems.
  * --user-install is no longer the default.  If you really liked it, see
    Gem::ConfigFile to learn how to set it by default.  (This change was made
    in 1.3.6)</pre>
<pre><strong>* RubyGems now has platform support for IronRuby.  Patch #27951 by Will Green.</strong></pre>
<pre>Bug fixes:</pre>
<pre>* Require rubygems/custom_require if --disable-gem was set.  Bug #27700 by
  Roger Pack.
* RubyGems now protects against exceptions being raised by plugins.
* rubygems/builder now requires user_interaction.  Ruby Bug #1040 by Phillip
  Toland.
* Gem::Dependency support #version_requirements= with a warning.  Fix for old
  Rails versions.  Bug #27868 by Wei Jen Lu.
* Gem::PackageTask depends on the package dir like the other rake package
  tasks so dependencies can be hooked up correctly.</pre>
<pre>------------------------------------------------------------------------------</pre>
<pre>RubyGems installed the following executables:</pre>
<pre>C:/Ruby/bin/gem</pre>
<pre>C:\Users\Will&gt;</pre>
<p>Sure, it&#8217;s a small contribution (having Ruby Gems recognize IronRuby as a platform), but an important one none the less. This allows us to create gems specifically for the .NET platform, similar to the way JRuby has JVM-specific gems.</p>
]]></content:encoded>
			<wfw:commentRss>http://hotgazpacho.org/2010/05/my-patch-to-ruby-gems-for-ironruby-support-is-in-1-3-7/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<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>IronRuby, Cucumber, &amp; win32console: Picking up the Gauntlet</title>
		<link>http://hotgazpacho.org/2009/06/ironruby-cucumber-win32console-picking-up-the-gauntlet/</link>
		<comments>http://hotgazpacho.org/2009/06/ironruby-cucumber-win32console-picking-up-the-gauntlet/#comments</comments>
		<pubDate>Sat, 20 Jun 2009 13:53:35 +0000</pubDate>
		<dc:creator>Will</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[cucumber]]></category>
		<category><![CDATA[gems]]></category>
		<category><![CDATA[ironruby]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://hotgazpacho.org/2009/06/ironruby-cucumber-win32console-picking-up-the-gauntlet/</guid>
		<description><![CDATA[Shortly after I published my previous post on getting IronRuby working with Cucumber, I did a git pull and recompile from the IronRuby repo. Well, something changed which broke command line option parsing for igem. I’m happy to report that this commit appears to have fixed the issue. Yay! Also, I’ve forked IronRuby on GitHub [...]]]></description>
			<content:encoded><![CDATA[<p>Shortly after I published <a href="http://hotgazpacho.org/2009/06/cucumber-and-ironruby-it-runs/">my previous post on getting IronRuby working with Cucumber</a>, I did a git pull and recompile from the IronRuby repo. Well, something changed which broke command line option parsing for igem. I’m happy to report that <a href="http://github.com/ironruby/ironruby/commit/2b73aba8bde0e6cf2ee0e579d6dabee57836708a">this commit</a> appears to have fixed the issue. Yay!</p>
<p>Also, I’ve <a href="http://github.com/hotgazpacho/ironruby">forked IronRuby on GitHub</a> and have made the changes I documented on the previous post to Dev.bat. I plan to track IronRuby closely, so if you don’t want to follow all the directions (I still recommend setting up the shortcut to dev.bat), you can simply clone my repo.</p>
<p>Finally, Shri Borde put out a call on the IronRuby mailing list <a href="http://rubyforge.org/pipermail/ironruby-core/2009-June/004683.html">asking if anyone was interested in porting win32console to IronRuby</a>. As Shri pointed out, this is important because Cucumber makes use of win32console on windows platforms to colorize the output of cucumber runs. This makes it much easier to visualize what works, what’s broken, and what steps you need to write. Since I have more than a passing interest in getting Cucumber working for .Net apps, I am going to pick up the gauntlet and attempt to port it myself. Behold <a href="http://github.com/hotgazpacho/ironruby-win32console/">ironruby-win32console</a>. Now, to figure out <em>how</em> to do it…</p>
]]></content:encoded>
			<wfw:commentRss>http://hotgazpacho.org/2009/06/ironruby-cucumber-win32console-picking-up-the-gauntlet/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Cucumber and IronRuby: It Runs!</title>
		<link>http://hotgazpacho.org/2009/06/cucumber-and-ironruby-it-runs/</link>
		<comments>http://hotgazpacho.org/2009/06/cucumber-and-ironruby-it-runs/#comments</comments>
		<pubDate>Sun, 14 Jun 2009 05:33:08 +0000</pubDate>
		<dc:creator>Will</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ironruby]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[IronRuby Cucumber BDD git]]></category>

		<guid isPermaLink="false">http://hotgazpacho.org/2009/06/cucumber-and-ironruby-it-runs/</guid>
		<description><![CDATA[Ever since I read about Cucumber, a user acceptance testing tool in Ruby, I’ve wanted to be able to use it, along with IronRuby for my .Net projects. I got it working once, briefly, using the directions on the Cucumber wiki at GitHub. With an uncertain combination of IronRuby updates and Cucumber updates, it stopped [...]]]></description>
			<content:encoded><![CDATA[<p>Ever since I read about <a href="http://cukes.info">Cucumber</a>, a user acceptance testing tool in Ruby, I’ve wanted to be able to use it, along with <a href="http://ironruby.net/">IronRuby</a> for my .Net projects. I got it working once, briefly, using the directions on the <a href="http://wiki.github.com/aslakhellesoy/cucumber/ironruby-and-net">Cucumber wiki at GitHub</a>. With an uncertain combination of IronRuby updates and Cucumber updates, it stopped working for me. Well, this evening, I decided to delve into it once again, and I am now happy to report that <strong>it works!</strong> Well, works, as in <em>runs the C# sample provided with the Cucumber gem</em>. I know present to you the steps I took to get it working, from end to end (I’ll assume you have some version of Visual Studio 2008 with C#):</p>
<h3>1 – Install MSysGit</h3>
<p>Head on over the the <a href="http://code.google.com/p/msysgit/downloads/list">MSysGit page</a>, grab the latest Git-1.6.x.y install, and run it. <em>At the time of this writing, I’m using 1.6.2.2-preview20090408</em></p>
<h3>2 – Grab the IronRuby sources</h3>
<p>I prefer to do all my development work in C:\Development. Pop open a Git Bash console (Start &gt; Programs &gt; Git &gt; Git Bash) and issue the following commands:</p>
<blockquote><pre>cd /C/Development
git clone git://github.com/ironruby/ironruby.git
git pull</pre>
</blockquote>
<p><strong>OR, if you&#8217;re behind a corporate firewall…</strong></p>
<blockquote>
<pre>cd /C/Development
git clone http://github.com/ironruby/ironruby.git
git pull</pre>
</blockquote>
<h3>3 – Set Up IronRuby Dev Environment</h3>
<p>This comes straight from the <em><a href="http://wiki.github.com/ironruby/ironruby/devbat">dev.bat entry in the IronRuby wiki on GitHub</a></em>:</p>
<blockquote>
<p>We recommend you start your developing by running</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:\path\to\Merlin\Main\Languages\Ruby\Scripts\Dev.bat</div></td></tr></tbody></table></div>
<p>. This batch file sets up the path, various environment variables, and aliases, which makes it easy to do builds and run tests.</p>
<p>It is recommended to setup a shortcut to Dev.bat on the desktop that you can just click to quickly get the pre-configured environment. To do this, create a shortcut on the Desktop to cmd.exe (where C:\Development\ironruby is the root of your GIT repo) looking like CmdShortcut.png at <a href="http://www.ironruby.net/Support/Images">http://www.ironruby.net/Support/Images</a>. The values of the text fields should be like this:</p>
<p>Target:</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:\Windows\System32\cmd.exe /k &amp;quot;c:\Development\IronRuby\Merlin\Main\Languages\Ruby\Scripts\Dev.bat&amp;quot;</div></td></tr></tbody></table></div>
</p>
<p>Start in:</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\IronRuby\Merlin\Main\Languages\Ruby</div></td></tr></tbody></table></div>
</p>
</blockquote>
<p>I highly recommend reading the rest of that wiki entry. It explains how the IronRuby sources are laid out.</p>
<p>I’m also made a change to Dev.bat. On line 43, after :EnvDone, the script changes the path. I’m going to prepend the path to the IronRuby interpreter, which we’ll compile in the next step. Why prepend? Well, I also have MRI in my path, and I found that the commands in C:\Ruby\bin were getting called instead of the IronRuby versions. <em>This is what I believe was leading to all the difficulties I had in the past.</em> So, the call to SET PATH should look something like this:</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">set PATH=%MERLIN_ROOT%\Bin\debug;%PATH%;%MERLIN_ROOT%\Languages\Ruby\Scripts;%MERLIN_ROOT%\Languages\Ruby\Scripts\bin;%RUBY18_BIN%;%MERLIN_ROOT%\..\External.LCA_RESTRICTED\Languages\IronRuby\mspec\mspec\bin</div></td></tr></tbody></table></div>
</p>
<h4>Addendum &#8211; June 14th, 2009</h4>
<p>After <a href="http://rubyforge.org/pipermail/ironruby-core/2009-June/004779.html">some feedback on this post</a> from <a href="http://blog.jimmy.schementi.com/">Jimmy Schementi</a> and <a href="http://blog.jredville.com/">Jim Deville</a> of the IronRuby team, you’re going to want to set another environment variable, called GEM_BIN. We will reference this variable later, when we go to install gems for IronRuby. After the line that sets GEM_PATH, about line 16, you want to include this additional line:</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">set GEM_BIN=%MERLIN_ROOT%\Languages\Ruby\Scripts\Bin</div></td></tr></tbody></table></div>
</p>
<p>Adding this will allow us to tell Ruby Gems where to put the scripts needed to run cucumber, or any other gem. I’ve chosen %MERLIN_ROOT%\Languages\Ruby\Scripts\Bin, on Jimmy’s suggestion, because it is already in the path set by Dev.bat, and IronRuby distributes a number of other wrapper scripts, such as igem, irake, and irails in this directory.</p>
<h3>4 &#8211; Compile IronRuby</h3>
<p>Pop open the IronRuby Development console <em>(the shortcut you created in the previous step)</em>, and run</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">brbd</div></td></tr></tbody></table></div>
<p>(Build RuBy Debug).</p>
<h3>5 – Install the Cucumber Gem</h3>
<p>IronRuby comes with a command called <em>igem</em>, which runs the <em>gem</em> command using IronRuby, as opposed to the standard MRI. In that same development console, run:</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">igem install –-no-rdoc -–no-ri –-bindir %GEM_BIN% cucumber</div></td></tr></tbody></table></div>
</p>
<p>That’s a lot to type! We could stick all these options into a .gemrc file in our home directory, but this is problematic if you have and use multiple versions of Ruby on your machine <em>(and you most likely will)</em>. Any suggestions for accommodating the scenario of multiple Ruby versions with seperate Gem locations would be very much appreciated! Now, back to the show!</p>
<p>I’m choosing to include the</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">–-no-rdoc</div></td></tr></tbody></table></div>
<p>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">-–no-ri</div></td></tr></tbody></table></div>
<p>because RDoc and RI generation is slooooow, and I can’t recall the last time I looked at either.</p>
<p>I’m also passing the</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">–-bindir</div></td></tr></tbody></table></div>
<p>argument so that the wrapper scripts for the gems I install will be placed into a directory that is in my path, but will not get overwritten every time I recompile IronRuby.</p>
<p>This will install the gem files into</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\ironruby\Merlin\External.LCA_RESTRICTED\Languages\Ruby\redist-libs\ironruby\gems\1.8\gems\cucumber-xxxx</div></td></tr></tbody></table></div>
<p>, where xxxx is the latest version of Cucumber. <em>I&#8217;m going to use cucumber-xxxx in the next step to signify the folder that cucumber gets installed into.</em></p>
<p>This will also install the</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">cucumber &amp;amp; cucumber.bat</div></td></tr></tbody></table></div>
<p>wrapper scripts into</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">&lt;strike&gt;C:\Development\ironruby\Merlin\Main\Bin\debug&lt;/strike&gt;C:\Development\ironruby\Merlin\Main\Languages\Ruby\Scripts\Bin</div></td></tr></tbody></table></div>
</p>
<h3>6 – Verify that it Works</h3>
<p>Here comes the cool part. In that same IronRuby dev console window, do the following:</p>
<blockquote>
<pre>cd C:\Development\ironruby\Merlin\External.LCA_RESTRICTED\Languages\Ruby\redist-libs\ironruby\gems\1.8\gems\cucumber-xxxx\examples\cs
compile.bat
cucumber features</pre>
</blockquote>
<p>This is the output that I got:</p>
<blockquote>
<pre>*** WARNING: You must &quot;gem install win32console&quot; (1.2.0 or higher) to get colour
ed output on MRI/Windows
Feature: Addition
  In order to avoid silly mistakes
  As a math idiot
  I want to be told the sum of two numbers

unknown:0: warning: multiple values for a block parameter (2 for 1)
unknown:0: warning: multiple values for a block parameter (2 for 1)
  Scenario Outline: Add two numbers                    # features/addition.feature:6
unknown:0: warning: multiple values for a block parameter (2 for 1)
    Given I have entered
<input_1> into the calculator # features/step_definitons/calculator_steps.rb:9
unknown:0: warning: multiple values for a block parameter (2 for 1)
    And I have entered
<input_2> into the calculator   # features/step_definitons/calculator_steps.rb:9
unknown:0: warning: multiple values for a block parameter (2 for 1)
    When I press add                                   # features/step_definitons/calculator_steps.rb:13
unknown:0: warning: multiple values for a block parameter (2 for 1)
    Then the result should be <output> on the screen   # features/step_definitons/calculator_steps.rb:17

    Examples:
      | input_1 | input_2 | output |
      | 20      | 30      | 50     |
      | 2       | 5       | 7      |
      | 0       | 40      | 40     |

3 scenarios (3 passed)
12 steps (12 passed)
0m3.734s</output></input_2></input_1></pre>
</blockquote>
<p>Notice that there are still some warnings. I know <a href="http://www.iunknown.com/">John Lam</a> and the rest of <a href="http://ironruby.net/About/People">the IronRuby team</a> are working hard for to get this working for the <a href="http://en.oreilly.com/oscon2009/public/schedule/detail/7965">1.0 release, due on or about July 23rd, 2009</a>. Most importantly, though, it functions now. Cool beans!</p>
<h3><strike>SUPER</strike> KIND-OF IMPORTANT NOTE!</h3>
<p>Any time you rebuild IronRuby, the C# compiler will erase the contents of the directory</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\IronRuby\Merlin\Main\Bin\Debug</div></td></tr></tbody></table></div>
<p>. This includes the cucumber and cucumber.bat files. <strike>The only way I know to rectify this is to </strike></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">&lt;strike&gt;igem install -–no-rdoc -–no-ri cucumber&lt;/strike&gt;</div></td></tr></tbody></table></div>
<p><strike> once again.</strike> Thanks to feedback from the IronRuby team, I’ve detailed a fix above. You will only have to install gems once, regardless of how often you recompile IronRuby.</p>
]]></content:encoded>
			<wfw:commentRss>http://hotgazpacho.org/2009/06/cucumber-and-ironruby-it-runs/feed/</wfw:commentRss>
		<slash:comments>9</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>
