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

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