<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>blog.mhartl &#124; Michael Hartl&#039;s tech blog &#187; Uncategorized</title>
	<atom:link href="http://blog.mhartl.com/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.mhartl.com</link>
	<description>Michael Hartl&#039;s tech blog</description>
	<lastBuildDate>Wed, 21 Dec 2011 11:47:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='blog.mhartl.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/4e51c93cc9bb9db581ae0a1592703f01?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>blog.mhartl &#124; Michael Hartl&#039;s tech blog &#187; Uncategorized</title>
		<link>http://blog.mhartl.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://blog.mhartl.com/osd.xml" title="blog.mhartl &#124; Michael Hartl&#039;s tech blog" />
	<atom:link rel='hub' href='http://blog.mhartl.com/?pushpress=hub'/>
		<item>
		<title>The Ruby on Rails Tutorial book &amp; screencasts</title>
		<link>http://blog.mhartl.com/2010/12/01/the-ruby-on-rails-tutorial-book-screencasts/</link>
		<comments>http://blog.mhartl.com/2010/12/01/the-ruby-on-rails-tutorial-book-screencasts/#comments</comments>
		<pubDate>Wed, 01 Dec 2010 20:16:07 +0000</pubDate>
		<dc:creator>mhartl</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.mhartl.com/?p=324</guid>
		<description><![CDATA[In October, I launched a product I&#8217;ve been working on for more than a year&#8212;the Ruby on Rails Tutorial book and screencast series&#8212;and yet somehow I neglected to make an announcement on my own tech blog! This post is an attempt to remedy that lamentable situation. In celebration of the launch, you can use the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.mhartl.com&amp;blog=3368824&amp;post=324&amp;subd=insoshi&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In October, I launched a product I&#8217;ve been working on for more than a year&mdash;the <a href="http://railstutorial.org/">Ruby on Rails Tutorial book and screencast series</a>&mdash;and yet somehow I neglected to make an announcement on my own tech blog! This post is an attempt to remedy that lamentable situation. In celebration of the launch, you can use the coupon code</p>
<p><tt>blogmhartl</tt></p>
<p>on the shopping cart page to get a 10% discount on any combination of <a href="http://railstutorial.org/">Ruby on Rails Tutorial</a> products through the end of the year.</p>
<p>The entire text of the <a href="http://railstutorial.org/ruby-on-rails-tutorial-book"><em>Ruby on Rails Tutorial</em> book</a> is available for free online, and yet many people have found it worthwhile to <a href="http://railstutorial.org/#buy">purchase the PDF</a>. I especially recommend the <a href="http://railstutorial.org/#buy">Rails Tutorial PDF/screencast bundle</a>, which includes more than 500 pages of material and more than 15&nbsp;hours of video. If you need further convincing, you can read the <a href="http://railstutorial.org/book#foreword">foreword by Derek Sivers</a>, the <a href="http://railstutorial.org/#praise">praise section</a>, or the <a href="http://www.drdobbs.com/blog/archives/2010/11/ruby_on_rails_t.html">recent review in Dr. Dobb&#8217;s</a>.</p>
<p><em>Note:</em> The <tt>blogmhartl</tt> coupon code for the <a href="http://railstutorial.org/">Ruby on Rails Tutorial</a> expires at midnight on January 1, 2011. Get it while it&#8217;s hot!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/insoshi.wordpress.com/324/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/insoshi.wordpress.com/324/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/insoshi.wordpress.com/324/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/insoshi.wordpress.com/324/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/insoshi.wordpress.com/324/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/insoshi.wordpress.com/324/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/insoshi.wordpress.com/324/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/insoshi.wordpress.com/324/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/insoshi.wordpress.com/324/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/insoshi.wordpress.com/324/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/insoshi.wordpress.com/324/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/insoshi.wordpress.com/324/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/insoshi.wordpress.com/324/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/insoshi.wordpress.com/324/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.mhartl.com&amp;blog=3368824&amp;post=324&amp;subd=insoshi&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.mhartl.com/2010/12/01/the-ruby-on-rails-tutorial-book-screencasts/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/ffda7d145b83c4b118f982401f962ca6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mhartl</media:title>
		</media:content>
	</item>
		<item>
		<title>Some rvm gotchas</title>
		<link>http://blog.mhartl.com/2010/02/19/some-rvm-gotchas/</link>
		<comments>http://blog.mhartl.com/2010/02/19/some-rvm-gotchas/#comments</comments>
		<pubDate>Fri, 19 Feb 2010 19:59:23 +0000</pubDate>
		<dc:creator>mhartl</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.mhartl.com/?p=251</guid>
		<description><![CDATA[Like many in Rails-land, I started playing with the Rails&#160;3 beta as soon as it came out. And, like many, I discovered to my chagrin that (a) Rails&#160;3 doesn&#8217;t play nice with Rails&#160;2.3 and (b) it doesn&#8217;t uninstall cleanly. (I ended up manually removing all 3.0.0.beta gems by hand.) If you ask around a bit, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.mhartl.com&amp;blog=3368824&amp;post=251&amp;subd=insoshi&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Like many in Rails-land, I started playing with the <a href="http://weblog.rubyonrails.org/2010/2/5/rails-3-0-beta-release">Rails&nbsp;3 beta</a> as soon as it came out. And, like many, I discovered to my chagrin that (a) Rails&nbsp;3 doesn&#8217;t play nice with Rails&nbsp;2.3 and (b) it doesn&#8217;t uninstall cleanly. (I ended up manually removing all <tt>3.0.0.beta</tt> gems by hand.) If you ask around a bit, you&#8217;ll quickly discover a solution to this problem (if you&#8217;re running a Mac), which is to run multiple Ruby versions and then install different versions of Rails on different Rubies. This works great in principle, but I ran into a few gotchas in the actual implementation, so I thought I&#8217;d share them for the benefit of Google searchers everywhere.</p>
<p>In order to manage the feat of multiple Rubies, the amazing <a href="http://rvm.beginrescueend.com/">Ruby Version Manager</a> (rvm) by Wayne Seguin is simply essential. Here are the steps I followed:</p>
<p>After <a href="http://rvm.beginrescueend.com/rvm/install/">installing rvm</a>, I first tried to install the latest version of Ruby&nbsp;1.8.7, which works with both Rails 2 and Rails 3:</p>
<pre>$ rvm install 1.8.7</pre>
<p>At this point I got a readline error, but this was covered by the <a href="http://rvm.beginrescueend.com/support/troubleshooting/">rvm troubleshooting guide</a>:</p>
<pre>$ rvm remove 1.8.7; rvm install readline</pre>
<p>Unfortunately, the installation still fails to build a makefile:</p>
<pre>$ rvm install 1.8.7
.
.
.
FAIL
$ less ~/.rvm/log/ruby-1.8.7-p249/make.error.log

[2010-02-12 08:54:30] make
make: *** No targets specified and no makefile found.  Stop.</pre>
<p>After searching around for a while, I finally found a page (location already forgotten) with the fix, which involves including an explicit path to the readline dependency:</p>
<pre>$ rvm remove 1.8.7
$ rvm install 1.8.7 -C --with-readline-dir=/Users/mhartl/.rvm/usr</pre>
<p>This still didn&#8217;t work, though; on my system (OS X 10.5 Leopard) I got a segfault, which shows up when installing certain gems:</p>
<pre>$ gem install metric_fu

/Users/mhartl/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/
spec_fetcher.rb:245: [BUG] Segmentation fault
ruby 1.8.7 (2010-01-10 patchlevel 249) [i686-darwin9.8.0]

Abort trap</pre>
<p>Luckily, I have a working Ruby 1.8.7 in <tt>/usr/local/bin</tt>, so I could check the patchlevel: <tt>p174</tt>. Since rvm installs the latest version by default (<tt>1.8.7-p249</tt> as of this writing), I had to indicate the patchlevel explicitly:</p>
<pre>$ rvm remove 1.8.7
$ rvm install 1.8.7-p174 -C --with-readline-dir=/Users/mhartl/.rvm/usr</pre>
<p>(Note that this also requires the explicit readline path.)</p>
<p>Finally, I had a working Ruby, but I wanted to set the rvm Ruby as the default, and my system wouldn&#8217;t remember it:</p>
<pre>$ rvm 1.8.7-p174 --default
$ which ruby
/Users/mhartl/.rvm/rubies/ruby-1.8.7-p174/bin/ruby
new shell...
$ which ruby
/usr/local/bin/ruby</pre>
<p>The solution was to remove the explicit <tt>/usr/local/bin</tt> path from my <tt>.bash_profile</tt> file:</p>
<pre>before:
  export PATH="/usr/local/bin:$HOME/bin:/usr/local/mysql/bin:$PATH"
  if [[ -s /Users/mhartl/.rvm/scripts/rvm ]] ; then source /Users/mhartl/.rvm/scripts/rvm ; fi

after:
  export PATH="$HOME/bin:/usr/local/mysql/bin:$PATH"
  if [[ -s /Users/mhartl/.rvm/scripts/rvm ]] ; then source /Users/mhartl/.rvm/scripts/rvm ; fi</pre>
<p>Wayne Seguin assures me that this step should be unnecessary as long as the <tt>PATH</tt> appears before the rvm line, but this is the only way I could get it to work on my system. (Since <tt>/usr/local/bin</tt> is on the system path, all the executables there still run; I&#8217;m not sure why I ever included it in <tt>.bash_profile</tt> in the first place.)</p>
<p>Finally, we&#8217;re ready for the raison d&#8217;être of all this work: multiple Rubies, multiple Rails. Here&#8217;s how to get it working (note the lack of <tt>sudo</tt> in the gem installations):</p>
<pre>$ rvm use 1.8.7
$ gem install rails -v 2.3.5
$ rvm install 1.9.2
$ rvm use 1.9.2
$ gem install rails --pre</pre>
<p>Voil&agrave;! Now switching between Rails versions is as easy as</p>
<pre>$ rvm use 1.8.7</pre>
<p>and</p>
<pre>$ rvm use 1.9.2</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/insoshi.wordpress.com/251/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/insoshi.wordpress.com/251/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/insoshi.wordpress.com/251/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/insoshi.wordpress.com/251/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/insoshi.wordpress.com/251/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/insoshi.wordpress.com/251/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/insoshi.wordpress.com/251/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/insoshi.wordpress.com/251/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/insoshi.wordpress.com/251/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/insoshi.wordpress.com/251/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/insoshi.wordpress.com/251/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/insoshi.wordpress.com/251/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/insoshi.wordpress.com/251/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/insoshi.wordpress.com/251/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.mhartl.com&amp;blog=3368824&amp;post=251&amp;subd=insoshi&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.mhartl.com/2010/02/19/some-rvm-gotchas/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/ffda7d145b83c4b118f982401f962ca6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mhartl</media:title>
		</media:content>
	</item>
		<item>
		<title>New RSS feed</title>
		<link>http://blog.mhartl.com/2009/04/28/new-rss-feed/</link>
		<comments>http://blog.mhartl.com/2009/04/28/new-rss-feed/#comments</comments>
		<pubDate>Tue, 28 Apr 2009 15:22:51 +0000</pubDate>
		<dc:creator>mhartl</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.mhartl.com/?p=225</guid>
		<description><![CDATA[This blog&#8217;s RSS feed has changed; please re-subscribe here: http://feeds2.feedburner.com/mhartl. (It might take an hour or two to go live. If it doesn&#8217;t work for you now, come back in a bit and try again.)<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.mhartl.com&amp;blog=3368824&amp;post=225&amp;subd=insoshi&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This blog&#8217;s RSS feed has changed; please re-subscribe here: <a title="Michael Hartl's tech blog RSS feed" href="http://feeds2.feedburner.com/mhartl">http://feeds2.feedburner.com/mhartl</a>. (It might take an hour or two to go live. If it doesn&#8217;t work for you now, come back in a bit and try again.)</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/insoshi.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/insoshi.wordpress.com/225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/insoshi.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/insoshi.wordpress.com/225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/insoshi.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/insoshi.wordpress.com/225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/insoshi.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/insoshi.wordpress.com/225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/insoshi.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/insoshi.wordpress.com/225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/insoshi.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/insoshi.wordpress.com/225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/insoshi.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/insoshi.wordpress.com/225/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.mhartl.com&amp;blog=3368824&amp;post=225&amp;subd=insoshi&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.mhartl.com/2009/04/28/new-rss-feed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/ffda7d145b83c4b118f982401f962ca6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mhartl</media:title>
		</media:content>
	</item>
	</channel>
</rss>
