<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/atom10full.xsl" type="text/xsl" media="screen"?><?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/itemcontent.css" type="text/css" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" xml:lang="en-US">
  <title>a timocracy of one</title>
  <subtitle type="html">Tim Connor's Blog</subtitle>
  <id>tag:www.timocracy.com,2005:Typo</id>
  <generator version="4.0" uri="http://www.typosphere.org">Typo</generator>
  
  <link href="http://www.timocracy.com" rel="alternate" type="text/html" />
  <updated>2008-11-12T06:00:00+00:00</updated>
  <link rel="self" href="http://www.timocracy.com/xml/atom10/feed.xml" type="application/atom+xml" /><feedburner:emailServiceId>839475</feedburner:emailServiceId><feedburner:feedburnerHostname>http://www.feedburner.com</feedburner:feedburnerHostname><feedburner:feedFlare href="http://add.my.yahoo.com/rss?url=http%3A%2F%2Fwww.timocracy.com%2Fxml%2Fatom10%2Ffeed.xml" src="http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif">Subscribe with My Yahoo!</feedburner:feedFlare><feedburner:feedFlare href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url=http%3A%2F%2Fwww.timocracy.com%2Fxml%2Fatom10%2Ffeed.xml" src="http://www.newsgator.com/images/ngsub1.gif">Subscribe with NewsGator</feedburner:feedFlare><feedburner:feedFlare href="http://feeds.my.aol.com/add.jsp?url=http%3A%2F%2Fwww.timocracy.com%2Fxml%2Fatom10%2Ffeed.xml" src="http://o.aolcdn.com/favorites.my.aol.com/webmaster/ffclient/webroot/locale/en-US/images/myAOLButtonSmall.gif">Subscribe with My AOL</feedburner:feedFlare><feedburner:feedFlare href="http://www.rojo.com/add-subscription?resource=http%3A%2F%2Fwww.timocracy.com%2Fxml%2Fatom10%2Ffeed.xml" src="http://blog.rojo.com/RojoWideRed.gif">Subscribe with Rojo</feedburner:feedFlare><feedburner:feedFlare href="http://www.bloglines.com/sub/http://www.timocracy.com/xml/atom10/feed.xml" src="http://www.bloglines.com/images/sub_modern11.gif">Subscribe with Bloglines</feedburner:feedFlare><feedburner:feedFlare href="http://www.netvibes.com/subscribe.php?url=http%3A%2F%2Fwww.timocracy.com%2Fxml%2Fatom10%2Ffeed.xml" src="http://www.netvibes.com/img/add2netvibes.gif">Subscribe with Netvibes</feedburner:feedFlare><feedburner:feedFlare href="http://fusion.google.com/add?feedurl=http%3A%2F%2Fwww.timocracy.com%2Fxml%2Fatom10%2Ffeed.xml" src="http://buttons.googlesyndication.com/fusion/add.gif">Subscribe with Google</feedburner:feedFlare><feedburner:feedFlare href="http://www.pageflakes.com/subscribe.aspx?url=http%3A%2F%2Fwww.timocracy.com%2Fxml%2Fatom10%2Ffeed.xml" src="http://www.pageflakes.com/ImageFile.ashx?instanceId=Static_4&amp;fileName=ATP_blu_91x17.gif">Subscribe with Pageflakes</feedburner:feedFlare><entry><title type="text">Links for 2008-11-11 [del.icio.us]</title><link rel="alternate" type="text/html" href="http://feeds.feedburner.com/~r/timocracy/~3/450346926/timocratic" /><updated>2008-11-12T00:00:00-06:00</updated><id>http://del.icio.us/timocratic#2008-11-11</id><summary type="html">&lt;ul&gt;
&lt;li&gt;&lt;a href="http://pivots.pivotallabs.com/users/amilligan/blog/articles/578-give-up-the-func"&gt;Corpus Adamicum - Give up the func&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</summary><content type="html">&lt;ul&gt;
&lt;li&gt;&lt;a href="http://pivots.pivotallabs.com/users/amilligan/blog/articles/578-give-up-the-func"&gt;Corpus Adamicum - Give up the func&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;img src="http://feeds.feedburner.com/~r/timocracy/~4/450346926" height="1" width="1"/&gt;</content><feedburner:origLink>http://del.icio.us/timocratic#2008-11-11</feedburner:origLink></entry><entry><title type="text">Links for 2008-10-16 [del.icio.us]</title><link rel="alternate" type="text/html" href="http://feeds.feedburner.com/~r/timocracy/~3/423374452/timocratic" /><updated>2008-10-17T00:00:00-05:00</updated><id>http://del.icio.us/timocratic#2008-10-16</id><summary type="html">&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.pathf.com/blogs/2008/10/walk-through-test-coverage/"&gt;Pathfinder Development &amp;raquo; Walk-Through Test Coverage&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</summary><content type="html">&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.pathf.com/blogs/2008/10/walk-through-test-coverage/"&gt;Pathfinder Development &amp;raquo; Walk-Through Test Coverage&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;img src="http://feeds.feedburner.com/~r/timocracy/~4/423374452" height="1" width="1"/&gt;</content><feedburner:origLink>http://del.icio.us/timocratic#2008-10-16</feedburner:origLink></entry><entry>
    <author>
      <name>Tim Connor</name>
    </author>
    <id>urn:uuid:3d699739-dcca-4424-a244-eb9bcd93d6e7</id>
    <published>2008-10-12T22:04:00-07:00</published>
    <updated>2008-10-12T22:15:19-07:00</updated>
    <title type="html">Manually setting the authored date in a git commit</title>
    <link href="http://feeds.feedburner.com/~r/timocracy/~3/419102376/manually-setting-the-authored-date-in-a-git-commit" rel="alternate" type="text/html" />
    <category term="misc" scheme="http://www.timocracy.com/articles/category/misc" label="Misc" />
    <category term="git" scheme="http://www.timocracy.com/articles/tag/git" />
    <summary type="html">&lt;p&gt;After my last post about &lt;a href="http://www.timocracy.com/articles/2008/10/12/editing-git-commits-with-rebase-in-particular-splitting-commits"&gt;splitting and otherwise reworking git commits via rebase&lt;/a&gt; I needed a way to manually set the authored date on a git commit, since I had overwritten that on some old commits.  And having earlier commits come a month after later ones looks a bit silly.  So I searched around in vain for how to set that field manually.&lt;/p&gt;


Thankfully, deskin on #git was able to quickly point me in the right direction. &lt;a href="http://www.kernel.org/pub/software/scm/git/docs/git-commit-tree.html"&gt;The docs for git-commit-tree&lt;/a&gt; talk about the environmental variables that determine the date, author, etc.  Git commit honors these (at it probably actually uses git-commit-tree, behind the scenes).  So to change the date on a commit (in the middle of a git-rebase, git-reset just set the environmental variable inline, thus (if you use bash):
&lt;pre&gt;&lt;code&gt;
 GIT_AUTHOR_DATE='2008-09-29 01:09:07' git commit
&lt;/code&gt;&lt;/pre&gt;
This will not work on an&amp;#8212;amend, though, since that is intended to just keep the same time and other settings for the commit, but just add some more changes.  These means to change the time you must follow the more complicated workflow in my previous post.</summary>
    <content type="html">&lt;p&gt;After my last post about &lt;a href="http://www.timocracy.com/articles/2008/10/12/editing-git-commits-with-rebase-in-particular-splitting-commits"&gt;splitting and otherwise reworking git commits via rebase&lt;/a&gt; I needed a way to manually set the authored date on a git commit, since I had overwritten that on some old commits.  And having earlier commits come a month after later ones looks a bit silly.  So I searched around in vain for how to set that field manually.&lt;/p&gt;


Thankfully, deskin on #git was able to quickly point me in the right direction. &lt;a href="http://www.kernel.org/pub/software/scm/git/docs/git-commit-tree.html"&gt;The docs for git-commit-tree&lt;/a&gt; talk about the environmental variables that determine the date, author, etc.  Git commit honors these (at it probably actually uses git-commit-tree, behind the scenes).  So to change the date on a commit (in the middle of a git-rebase, git-reset just set the environmental variable inline, thus (if you use bash):
&lt;pre&gt;&lt;code&gt;
 GIT_AUTHOR_DATE='2008-09-29 01:09:07' git commit
&lt;/code&gt;&lt;/pre&gt;
This will not work on an&amp;#8212;amend, though, since that is intended to just keep the same time and other settings for the commit, but just add some more changes.  These means to change the time you must follow the more complicated workflow in my previous post.&lt;img src="http://feeds.feedburner.com/~r/timocracy/~4/419102376" height="1" width="1"/&gt;</content>
  <feedburner:origLink>http://www.timocracy.com/articles/2008/10/12/manually-setting-the-authored-date-in-a-git-commit</feedburner:origLink></entry>
  <entry>
    <author>
      <name>Tim Connor</name>
    </author>
    <id>urn:uuid:c3a71577-3160-4ae3-856d-2bf182f8ed85</id>
    <published>2008-10-12T21:44:00-07:00</published>
    <updated>2008-10-12T22:03:42-07:00</updated>
    <title type="html">Editing git commits with rebase, in particular splitting commits</title>
    <link href="http://feeds.feedburner.com/~r/timocracy/~3/419091582/editing-git-commits-with-rebase-in-particular-splitting-commits" rel="alternate" type="text/html" />
    <category term="misc" scheme="http://www.timocracy.com/articles/category/misc" label="Misc" />
    <category term="git" scheme="http://www.timocracy.com/articles/tag/git" />
    <summary type="html">&lt;p&gt;So I have a project on github that I wanted to rework some of the commits before anyone sees them.  I used to manage the project via svk, so the commits are squashed down into less granular blocks than I want for reviewing via an interface like githubs.  &amp;#8216;git commit&amp;#8212;amends&amp;#8217; for, well, amending the last commit you made, but if the changes are further back than that, you get into the deep magic of rebasing.  Much of this is discussed in the &lt;a href="http://www.kernel.org/pub/software/scm/git/docs/git-rebase.html"&gt;man pages, and docs for git-rebase&lt;/a&gt; but that can be hard to follow until you really understand what is happening.&lt;/p&gt;


	&lt;p&gt;&amp;#8216;git-rebase -i &lt;span class="caps"&gt;SHA&lt;/span&gt;_OF_PARENT&amp;#8217; lets you rollback to the commit before where you want to start mucking with stuff, mark which commits you want to edit, and then recommit them.  For the simplest use case, just editing the commit messages, you just &amp;#8216;commit&amp;#8212;amend&amp;#8217; each time git-rebase pauses, &amp;#8216;git-rebase&amp;#8212;continue&amp;#8217; and repeat until done.  This workflow is explained reasonably well in the docs, the only thing to emphasize that will help you understand the more complex cases is that it works by rebase pausing just &lt;strong&gt;after&lt;/strong&gt; each commit you marked for editing, so that you can amend (which amends that &lt;strong&gt;last&lt;/strong&gt; commit) and continue.&lt;/p&gt;


	&lt;p&gt;This segues into how splitting up of commits works.  You mark for editing and rebase as usual.  When it pauses after the commit you want to split up, you &amp;#8216;git reset &lt;span class="caps"&gt;HEAD&lt;/span&gt;^&amp;#8217; to rewind one commit, while keeping the changes in the filesystem.  So at this point, if you committed and continued, it&amp;#8217;s be exactly like the simpler workflow.  Instead, though, you can split up the changes: git add each subset of changes, committing them with the appropriate message.  Then when you are done, rebase&amp;#8212;continue again.&lt;/p&gt;


	&lt;p&gt;With these techniques you can rework the history completely into a better organized, more easily follow-able set of chunks.  It does leave a couple problems, if it is a repo you have already pushed you will get a &amp;#8216;not strictly subset&amp;#8217; error.  If you know nobody has pulled from it, you can just push&amp;#8212;force, but I make no guarantees what this might do to the state of other peoples repos that are pulling from the same master, especially if they are mucking about similarly.&lt;/p&gt;


	&lt;p&gt;The other problem is that this resets the authored by date on the commits, since it&amp;#8217;s essentially nuking one commit and making a new one.  I&amp;#8217;ll discuss this in the next post &lt;a href="http://www.timocracy.com/articles/2008/10/12/manually-setting-the-authored-date-in-a-git-commit"&gt;manually setting the authored date in a git commit&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;deskin&lt;/p&gt;</summary>
    <content type="html">&lt;p&gt;So I have a project on github that I wanted to rework some of the commits before anyone sees them.  I used to manage the project via svk, so the commits are squashed down into less granular blocks than I want for reviewing via an interface like githubs.  &amp;#8216;git commit&amp;#8212;amends&amp;#8217; for, well, amending the last commit you made, but if the changes are further back than that, you get into the deep magic of rebasing.  Much of this is discussed in the &lt;a href="http://www.kernel.org/pub/software/scm/git/docs/git-rebase.html"&gt;man pages, and docs for git-rebase&lt;/a&gt; but that can be hard to follow until you really understand what is happening.&lt;/p&gt;


	&lt;p&gt;&amp;#8216;git-rebase -i &lt;span class="caps"&gt;SHA&lt;/span&gt;_OF_PARENT&amp;#8217; lets you rollback to the commit before where you want to start mucking with stuff, mark which commits you want to edit, and then recommit them.  For the simplest use case, just editing the commit messages, you just &amp;#8216;commit&amp;#8212;amend&amp;#8217; each time git-rebase pauses, &amp;#8216;git-rebase&amp;#8212;continue&amp;#8217; and repeat until done.  This workflow is explained reasonably well in the docs, the only thing to emphasize that will help you understand the more complex cases is that it works by rebase pausing just &lt;strong&gt;after&lt;/strong&gt; each commit you marked for editing, so that you can amend (which amends that &lt;strong&gt;last&lt;/strong&gt; commit) and continue.&lt;/p&gt;


	&lt;p&gt;This segues into how splitting up of commits works.  You mark for editing and rebase as usual.  When it pauses after the commit you want to split up, you &amp;#8216;git reset &lt;span class="caps"&gt;HEAD&lt;/span&gt;^&amp;#8217; to rewind one commit, while keeping the changes in the filesystem.  So at this point, if you committed and continued, it&amp;#8217;s be exactly like the simpler workflow.  Instead, though, you can split up the changes: git add each subset of changes, committing them with the appropriate message.  Then when you are done, rebase&amp;#8212;continue again.&lt;/p&gt;


	&lt;p&gt;With these techniques you can rework the history completely into a better organized, more easily follow-able set of chunks.  It does leave a couple problems, if it is a repo you have already pushed you will get a &amp;#8216;not strictly subset&amp;#8217; error.  If you know nobody has pulled from it, you can just push&amp;#8212;force, but I make no guarantees what this might do to the state of other peoples repos that are pulling from the same master, especially if they are mucking about similarly.&lt;/p&gt;


	&lt;p&gt;The other problem is that this resets the authored by date on the commits, since it&amp;#8217;s essentially nuking one commit and making a new one.  I&amp;#8217;ll discuss this in the next post &lt;a href="http://www.timocracy.com/articles/2008/10/12/manually-setting-the-authored-date-in-a-git-commit"&gt;manually setting the authored date in a git commit&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;deskin&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/timocracy/~4/419091582" height="1" width="1"/&gt;</content>
  <feedburner:origLink>http://www.timocracy.com/articles/2008/10/12/editing-git-commits-with-rebase-in-particular-splitting-commits</feedburner:origLink></entry>
  <entry>
    <author>
      <name>Tim Connor</name>
    </author>
    <id>urn:uuid:0c2c8ae2-1deb-4632-be58-39c3222b4b3b</id>
    <published>2008-10-12T16:12:00-07:00</published>
    <updated>2008-10-12T16:17:39-07:00</updated>
    <title type="html">Importing a large sql file directly into mysql via a rails migration</title>
    <link href="http://feeds.feedburner.com/~r/timocracy/~3/418870072/importing-a-large-sql-file-directly-into-mysql-via-a-rails-migration" rel="alternate" type="text/html" />
    <category term="rails" scheme="http://www.timocracy.com/articles/category/rails" label="Rails" />
    <category term="mysql" scheme="http://www.timocracy.com/articles/tag/mysql" />
    <summary type="html">or otherwise running a sql file through the mysql commandline client, with the current connection details:
&lt;pre&gt;&lt;code&gt;
class CreateZipCodes &amp;lt; ActiveRecord::Migration
  def self.up
    #Loading that large of a YAML file can cause problems
    zip_code_file =  File.expand_path(File.join(File.dirname(__FILE__), "..", "zip_codes.sql"))
    config = ActiveRecord::Base.connection.instance_variable_get('@config')
    `mysql -u#{config[:username]} -p#{config[:password]} #{config[:database]} &amp;lt; #{zip_code_file}`
  end

  def self.down
    drop_table :zip_codes
  end
end
&lt;/code&gt;&lt;/pre&gt;</summary>
    <content type="html">or otherwise running a sql file through the mysql commandline client, with the current connection details:
&lt;pre&gt;&lt;code&gt;
class CreateZipCodes &amp;lt; ActiveRecord::Migration
  def self.up
    #Loading that large of a YAML file can cause problems
    zip_code_file =  File.expand_path(File.join(File.dirname(__FILE__), "..", "zip_codes.sql"))
    config = ActiveRecord::Base.connection.instance_variable_get('@config')
    `mysql -u#{config[:username]} -p#{config[:password]} #{config[:database]} &amp;lt; #{zip_code_file}`
  end

  def self.down
    drop_table :zip_codes
  end
end
&lt;/code&gt;&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/timocracy/~4/418870072" height="1" width="1"/&gt;</content>
  <feedburner:origLink>http://www.timocracy.com/articles/2008/10/12/importing-a-large-sql-file-directly-into-mysql-via-a-rails-migration</feedburner:origLink></entry>
  <entry><title type="text">Links for 2008-10-08 [del.icio.us]</title><link rel="alternate" type="text/html" href="http://feeds.feedburner.com/~r/timocracy/~3/415450065/timocratic" /><updated>2008-10-09T00:00:00-05:00</updated><id>http://del.icio.us/timocratic#2008-10-08</id><summary type="html">&lt;ul&gt;
&lt;li&gt;&lt;a href="http://therailscoder.typepad.com/the_rails_coder_ruby_on_r/2008/04/using-gmail-smt.html"&gt;The Rails Coder: Develop &amp;amp; Deploy: Using GMail SMTP with ActionMailer&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</summary><content type="html">&lt;ul&gt;
&lt;li&gt;&lt;a href="http://therailscoder.typepad.com/the_rails_coder_ruby_on_r/2008/04/using-gmail-smt.html"&gt;The Rails Coder: Develop &amp;amp; Deploy: Using GMail SMTP with ActionMailer&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;img src="http://feeds.feedburner.com/~r/timocracy/~4/415450065" height="1" width="1"/&gt;</content><feedburner:origLink>http://del.icio.us/timocratic#2008-10-08</feedburner:origLink></entry><entry>
    <author>
      <name>Tim Connor</name>
    </author>
    <id>urn:uuid:14dba76f-c5c9-4125-bef7-572ee6576637</id>
    <published>2008-09-20T20:45:00-07:00</published>
    <updated>2008-09-20T20:49:15-07:00</updated>
    <title type="html">Trouble with git-svn locating svn perl language bindings - Can't locate SVN/Core.pm</title>
    <link href="http://feeds.feedburner.com/~r/timocracy/~3/398548177/trouble-with-git-svn-locating-svn-perl-language-bindings-cant-locate-svn-core-pm" rel="alternate" type="text/html" />
    <category term="misc" scheme="http://www.timocracy.com/articles/category/misc" label="Misc" />
    <category term="git" scheme="http://www.timocracy.com/articles/tag/git" />
    <summary type="html">&lt;p&gt;If you get an error &amp;#8220;Can&amp;#8217;t locate &lt;span class="caps"&gt;SVN&lt;/span&gt;/Core.pm&amp;#8221; when trying to use git-svn, it cannot find your perl bindings.  After endless troubles trying to get things to either compile from source, or from macports (a dependency, apr_util, would not compile on my system), and with no luck with the binaries I was frustrated.  But I finally found a &lt;a href="http://gvinu.blogspot.com/2007/10/git-on-mac-os-x-tiger-macbook.html"&gt;blog post that told me I had to set the $PERL5LIB environmental variable, if I was getting that error.&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;So I added &amp;#8220;export &lt;span class="caps"&gt;PERL5LIB&lt;/span&gt;=/opt/subversion/lib/svn-perl/&amp;#8221; to the end of my .profile, and I was good to go.&lt;/p&gt;</summary>
    <content type="html">&lt;p&gt;If you get an error &amp;#8220;Can&amp;#8217;t locate &lt;span class="caps"&gt;SVN&lt;/span&gt;/Core.pm&amp;#8221; when trying to use git-svn, it cannot find your perl bindings.  After endless troubles trying to get things to either compile from source, or from macports (a dependency, apr_util, would not compile on my system), and with no luck with the binaries I was frustrated.  But I finally found a &lt;a href="http://gvinu.blogspot.com/2007/10/git-on-mac-os-x-tiger-macbook.html"&gt;blog post that told me I had to set the $PERL5LIB environmental variable, if I was getting that error.&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;So I added &amp;#8220;export &lt;span class="caps"&gt;PERL5LIB&lt;/span&gt;=/opt/subversion/lib/svn-perl/&amp;#8221; to the end of my .profile, and I was good to go.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/timocracy/~4/398548177" height="1" width="1"/&gt;</content>
  <feedburner:origLink>http://www.timocracy.com/articles/2008/09/20/trouble-with-git-svn-locating-svn-perl-language-bindings-cant-locate-svn-core-pm</feedburner:origLink></entry>
  <entry>
    <author>
      <name>Tim Connor</name>
    </author>
    <id>urn:uuid:955ae683-26e5-4a0b-bab4-0dd8c64eff01</id>
    <published>2008-09-18T18:14:00-07:00</published>
    <updated>2008-09-18T18:22:30-07:00</updated>
    <title type="html">Updating ARTS', or assert_rjs', :insert_html to work with Rails 2.1-stable</title>
    <link href="http://feeds.feedburner.com/~r/timocracy/~3/396661598/updating-arts-or-assert_rjs-insert_html-to-work-with-rails-2-1-stable" rel="alternate" type="text/html" />
    <category term="rails" scheme="http://www.timocracy.com/articles/category/rails" label="Rails" />
    <category term="rails" scheme="http://www.timocracy.com/articles/tag/rails" />
    <category term="github" scheme="http://www.timocracy.com/articles/tag/github" />
    <summary type="html">&lt;p&gt;I updated our Rails at work today, and got some test failures, because &lt;em&gt;page.insert_html&lt;/em&gt; switched from using &lt;em&gt;new Insertion&lt;/em&gt; to &lt;em&gt;Element.insert&lt;/em&gt;.  So that other people could get the benefit of the quick fix, I found a mirror someone had thrown up on github, forked it, and made my changes.  So here is &lt;a href="http://github.com/timocratic/arts/"&gt;my copy of arts, on github&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;The only problem with this is the original githubber for it, &lt;a href="http://github.com/richpoirier"&gt;Rich Poirier&lt;/a&gt;, set the author for the original commits as kevinc, but Kevin Clark&amp;#8217;s username on github is actually &lt;a href="http://github.com/kevinclark"&gt;kevinclark&lt;/a&gt;.  I don&amp;#8217;t think Kevin will mind too much, since he&amp;#8217;s not maintaining it, it&amp;#8217;s &lt;span class="caps"&gt;BSD&lt;/span&gt;, and he said do whatever with it, on &amp;#8216;boose.&lt;/p&gt;</summary>
    <content type="html">&lt;p&gt;I updated our Rails at work today, and got some test failures, because &lt;em&gt;page.insert_html&lt;/em&gt; switched from using &lt;em&gt;new Insertion&lt;/em&gt; to &lt;em&gt;Element.insert&lt;/em&gt;.  So that other people could get the benefit of the quick fix, I found a mirror someone had thrown up on github, forked it, and made my changes.  So here is &lt;a href="http://github.com/timocratic/arts/"&gt;my copy of arts, on github&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;The only problem with this is the original githubber for it, &lt;a href="http://github.com/richpoirier"&gt;Rich Poirier&lt;/a&gt;, set the author for the original commits as kevinc, but Kevin Clark&amp;#8217;s username on github is actually &lt;a href="http://github.com/kevinclark"&gt;kevinclark&lt;/a&gt;.  I don&amp;#8217;t think Kevin will mind too much, since he&amp;#8217;s not maintaining it, it&amp;#8217;s &lt;span class="caps"&gt;BSD&lt;/span&gt;, and he said do whatever with it, on &amp;#8216;boose.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/timocracy/~4/396661598" height="1" width="1"/&gt;</content>
  <feedburner:origLink>http://www.timocracy.com/articles/2008/09/18/updating-arts-or-assert_rjs-insert_html-to-work-with-rails-2-1-stable</feedburner:origLink></entry>
  <entry><title type="text">Links for 2008-09-15 [del.icio.us]</title><link rel="alternate" type="text/html" href="http://feeds.feedburner.com/~r/timocracy/~3/393875194/timocratic" /><updated>2008-09-16T00:00:00-05:00</updated><id>http://del.icio.us/timocratic#2008-09-15</id><summary type="html">&lt;ul&gt;
&lt;li&gt;&lt;a href="http://blog.scoutapp.com/articles/2008/09/09/rails-monitoring-pillars"&gt;The 3 pillars of our Rails Monitoring Stack&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</summary><content type="html">&lt;ul&gt;
&lt;li&gt;&lt;a href="http://blog.scoutapp.com/articles/2008/09/09/rails-monitoring-pillars"&gt;The 3 pillars of our Rails Monitoring Stack&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;img src="http://feeds.feedburner.com/~r/timocracy/~4/393875194" height="1" width="1"/&gt;</content><feedburner:origLink>http://del.icio.us/timocratic#2008-09-15</feedburner:origLink></entry><entry><title type="text">Links for 2008-09-06 [del.icio.us]</title><link rel="alternate" type="text/html" href="http://feeds.feedburner.com/~r/timocracy/~3/385541147/timocratic" /><updated>2008-09-07T00:00:00-05:00</updated><id>http://del.icio.us/timocratic#2008-09-06</id><summary type="html">&lt;ul&gt;
&lt;li&gt;&lt;a href="http://stephencelis.com/archive/2008/9/rails-controllers-views-and-variables"&gt;stephencelis &amp;mdash; Rails controllers, views, and variables&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</summary><content type="html">&lt;ul&gt;
&lt;li&gt;&lt;a href="http://stephencelis.com/archive/2008/9/rails-controllers-views-and-variables"&gt;stephencelis &amp;mdash; Rails controllers, views, and variables&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;img src="http://feeds.feedburner.com/~r/timocracy/~4/385541147" height="1" width="1"/&gt;</content><feedburner:origLink>http://del.icio.us/timocratic#2008-09-06</feedburner:origLink></entry><entry><title type="text">Links for 2008-09-02 [del.icio.us]</title><link rel="alternate" type="text/html" href="http://feeds.feedburner.com/~r/timocracy/~3/382011552/timocratic" /><updated>2008-09-03T00:00:00-05:00</updated><id>http://del.icio.us/timocratic#2008-09-02</id><summary type="html">&lt;ul&gt;
&lt;li&gt;&lt;a href="http://politicalwire.com/archives/2005/06/24/masters_of_dog_whistle_politics.html"&gt;Masters of Dog Whistle Politics -- Political Wire&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</summary><content type="html">&lt;ul&gt;
&lt;li&gt;&lt;a href="http://politicalwire.com/archives/2005/06/24/masters_of_dog_whistle_politics.html"&gt;Masters of Dog Whistle Politics -- Political Wire&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;img src="http://feeds.feedburner.com/~r/timocracy/~4/382011552" height="1" width="1"/&gt;</content><feedburner:origLink>http://del.icio.us/timocratic#2008-09-02</feedburner:origLink></entry><entry>
    <author>
      <name>Tim Connor</name>
    </author>
    <id>urn:uuid:0705331c-8380-4aa5-b387-545bfd0ed166</id>
    <published>2008-08-29T17:54:00-07:00</published>
    <updated>2008-08-29T17:56:35-07:00</updated>
    <title type="html">Looking for more engineers again</title>
    <link href="http://feeds.feedburner.com/~r/timocracy/~3/378463958/looking-for-more-engineers-again" rel="alternate" type="text/html" />
    <category term="rails" scheme="http://www.timocracy.com/articles/category/rails" label="Rails" />
    <category term="hiring" scheme="http://www.timocracy.com/articles/tag/hiring" />
    <summary type="html">&lt;p&gt;My work has &lt;a href="http://jobs.37signals.com/jobs/4268"&gt;posted a listing for Rails developers&lt;/a&gt; over that the 37S job board.  The listing pretty much says it all.&lt;/p&gt;</summary>
    <content type="html">&lt;p&gt;My work has &lt;a href="http://jobs.37signals.com/jobs/4268"&gt;posted a listing for Rails developers&lt;/a&gt; over that the 37S job board.  The listing pretty much says it all.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/timocracy/~4/378463958" height="1" width="1"/&gt;</content>
  <feedburner:origLink>http://www.timocracy.com/articles/2008/08/29/looking-for-more-engineers-again</feedburner:origLink></entry>
  <entry>
    <author>
      <name>Tim Connor</name>
    </author>
    <id>urn:uuid:207d4883-de72-4347-94ad-dd60bd88a90e</id>
    <published>2008-08-13T18:50:00-07:00</published>
    <updated>2008-08-13T23:00:55-07:00</updated>
    <title type="html">Clarification on Passenger Phusion for rails on DreamHost</title>
    <link href="http://feeds.feedburner.com/~r/timocracy/~3/364327667/clarification-on-passenger-phusion-for-rails-on-dreamhost" rel="alternate" type="text/html" />
    <category term="rails" scheme="http://www.timocracy.com/articles/category/rails" label="Rails" />
    <category term="hosting" scheme="http://www.timocracy.com/articles/category/hosting" label="Hosting" />
    <category term="dreamhost" scheme="http://www.timocracy.com/articles/tag/dreamhost" />
    <category term="mod_rails" scheme="http://www.timocracy.com/articles/tag/mod_rails" />
    <summary type="html">&lt;p&gt;In my &lt;a href="http://www.timocracy.com/articles/2008/08/13/rails-on-mod_rails-aka-passenger-phusion-on-dreamhost-ps"&gt;previous post, where I relate my experience using phusion/mod_rails on DreamHost PS&lt;/a&gt;, I was not suggesting it as a replacement for a nginx/mongrel_cluster.  If you already running those happily, then you already have more control over things, and probably have everything in place to manage them.  If you want a quick, easy deployment on a shared/semi-shared host, though, phusion is hard to beat.  Especially since, if you are going the DH route, the &lt;a href="http://blog.12spokes.com/articles/2008/02/18/using-nginx-as-a-load-balancing-proxy-to-a-mongrel-cluster-on-dreamhost"&gt;single mongrel set-up of DreamHost PS requires you to juggle things around, and you&amp;#8217;ll end up running nginx anyways.&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;So, in that case, for something as minor as a blog, or a minor app, it&amp;#8217;s pretty easy to just use phusion.&lt;/p&gt;


Oh, and I did finally send DH a support ticket to turn my mod_rewrite back on &amp;#8211; it&amp;#8217;s disabled by default, since the default .httaccess people have routes to &lt;span class="caps"&gt;FCGI&lt;/span&gt;.  First, though, I commented those sections out.
&lt;pre&gt;&lt;code&gt;
#RewriteRule ^$ index.html [QSA]
#RewriteRule ^([^.]+)$ $1.html [QSA]
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
&lt;/pre&gt;&lt;/code&gt;

	&lt;p&gt;DreamHost support got to my ticket unusually quickly and sure enough it was enabled&amp;#8230; and my site was throwing 500 errors for a minute, in the apparently usual config change hiccups.  Before support could get back to me the second time, it started Just Working again.  So yes, mod_rewrite and mod_rails on &lt;span class="caps"&gt;DH PS&lt;/span&gt;, seem to be a-okay.  On the other hand, I have &lt;strong&gt;not&lt;/strong&gt; tried phusion on purely shared hosting.  My venerable Typo install runs my PS up to about 150-200 megs, on average, so that&amp;#8217;s probably a no-go for me.  I suspect a small merb app wouldn&amp;#8217;t have any problems&lt;/p&gt;</summary>
    <content type="html">&lt;p&gt;In my &lt;a href="http://www.timocracy.com/articles/2008/08/13/rails-on-mod_rails-aka-passenger-phusion-on-dreamhost-ps"&gt;previous post, where I relate my experience using phusion/mod_rails on DreamHost PS&lt;/a&gt;, I was not suggesting it as a replacement for a nginx/mongrel_cluster.  If you already running those happily, then you already have more control over things, and probably have everything in place to manage them.  If you want a quick, easy deployment on a shared/semi-shared host, though, phusion is hard to beat.  Especially since, if you are going the DH route, the &lt;a href="http://blog.12spokes.com/articles/2008/02/18/using-nginx-as-a-load-balancing-proxy-to-a-mongrel-cluster-on-dreamhost"&gt;single mongrel set-up of DreamHost PS requires you to juggle things around, and you&amp;#8217;ll end up running nginx anyways.&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;So, in that case, for something as minor as a blog, or a minor app, it&amp;#8217;s pretty easy to just use phusion.&lt;/p&gt;


Oh, and I did finally send DH a support ticket to turn my mod_rewrite back on &amp;#8211; it&amp;#8217;s disabled by default, since the default .httaccess people have routes to &lt;span class="caps"&gt;FCGI&lt;/span&gt;.  First, though, I commented those sections out.
&lt;pre&gt;&lt;code&gt;
#RewriteRule ^$ index.html [QSA]
#RewriteRule ^([^.]+)$ $1.html [QSA]
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
&lt;/pre&gt;&lt;/code&gt;

	&lt;p&gt;DreamHost support got to my ticket unusually quickly and sure enough it was enabled&amp;#8230; and my site was throwing 500 errors for a minute, in the apparently usual config change hiccups.  Before support could get back to me the second time, it started Just Working again.  So yes, mod_rewrite and mod_rails on &lt;span class="caps"&gt;DH PS&lt;/span&gt;, seem to be a-okay.  On the other hand, I have &lt;strong&gt;not&lt;/strong&gt; tried phusion on purely shared hosting.  My venerable Typo install runs my PS up to about 150-200 megs, on average, so that&amp;#8217;s probably a no-go for me.  I suspect a small merb app wouldn&amp;#8217;t have any problems&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/timocracy/~4/364327667" height="1" width="1"/&gt;</content>
  <feedburner:origLink>http://www.timocracy.com/articles/2008/08/13/clarification-on-passenger-phusion-for-rails-on-dreamhost</feedburner:origLink></entry>
  <entry>
    <author>
      <name>Tim Connor</name>
    </author>
    <id>urn:uuid:1c5e92ff-4722-4bf2-a0d2-66fc689b15f1</id>
    <published>2008-08-13T13:33:00-07:00</published>
    <updated>2008-08-13T13:48:54-07:00</updated>
    <title type="html">Rails on mod_rails aka Passenger Phusion on DreamHost PS</title>
    <link href="http://feeds.feedburner.com/~r/timocracy/~3/364113704/rails-on-mod_rails-aka-passenger-phusion-on-dreamhost-ps" rel="alternate" type="text/html" />
    <category term="rails" scheme="http://www.timocracy.com/articles/category/rails" label="Rails" />
    <category term="hosting" scheme="http://www.timocracy.com/articles/category/hosting" label="Hosting" />
    <category term="dreamhost" scheme="http://www.timocracy.com/articles/tag/dreamhost" />
    <summary type="html">&lt;p&gt;So, when moving my DH account over to their &lt;span class="caps"&gt;VPS&lt;/span&gt;-ish offering, I decided to stick with fcgi for a while to see how it did under less memory constrained circumstances.  My blog stayed up way better, but memory usage definitely climbed consistently, and the server needed restarting every week or two.  Killing off the ruby&amp;#8217;s and the fcgi&amp;#8217;s didn&amp;#8217;t seem to be enough, for some reason.&lt;/p&gt;


	&lt;p&gt;So, with that as a baseline, I switched over to mod_rails.  It started with an immediate jump up in memory, which had me slightly worried.  And, it was a little spikier on memory usage.  But, it is steady and consistent.  I haven&amp;#8217;t had to restart the module, much less my server, since I switched.  It seems to be spikier (and in retrospect, they are pretty small spikes), because it actually grabs and releases memory as it needs it, unlike &lt;span class="caps"&gt;FCGI&lt;/span&gt;, which just seemed to slowly leak memory away to some hidden land where the mallocs play.&lt;/p&gt;


	&lt;p&gt;One side-note, if you are using rewrites for things like redirecting your rss to feedburner, you may need to adjust them, as the switch can mess with that.  I haven&amp;#8217;t fixed mine yet, and briefly wondered why my feedburner stats fell way off.&lt;/p&gt;


	&lt;p&gt;&lt;img src="http://img.skitch.com/20080813-nagn8pfan1qm6btsmn6s71ryab.png" alt="DreamHost Web Panel"/&gt;&lt;/p&gt;</summary>
    <content type="html">&lt;p&gt;So, when moving my DH account over to their &lt;span class="caps"&gt;VPS&lt;/span&gt;-ish offering, I decided to stick with fcgi for a while to see how it did under less memory constrained circumstances.  My blog stayed up way better, but memory usage definitely climbed consistently, and the server needed restarting every week or two.  Killing off the ruby&amp;#8217;s and the fcgi&amp;#8217;s didn&amp;#8217;t seem to be enough, for some reason.&lt;/p&gt;


	&lt;p&gt;So, with that as a baseline, I switched over to mod_rails.  It started with an immediate jump up in memory, which had me slightly worried.  And, it was a little spikier on memory usage.  But, it is steady and consistent.  I haven&amp;#8217;t had to restart the module, much less my server, since I switched.  It seems to be spikier (and in retrospect, they are pretty small spikes), because it actually grabs and releases memory as it needs it, unlike &lt;span class="caps"&gt;FCGI&lt;/span&gt;, which just seemed to slowly leak memory away to some hidden land where the mallocs play.&lt;/p&gt;


	&lt;p&gt;One side-note, if you are using rewrites for things like redirecting your rss to feedburner, you may need to adjust them, as the switch can mess with that.  I haven&amp;#8217;t fixed mine yet, and briefly wondered why my feedburner stats fell way off.&lt;/p&gt;


	&lt;p&gt;&lt;img src="http://img.skitch.com/20080813-nagn8pfan1qm6btsmn6s71ryab.png" alt="DreamHost Web Panel"/&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/timocracy/~4/364113704" height="1" width="1"/&gt;</content>
  <feedburner:origLink>http://www.timocracy.com/articles/2008/08/13/rails-on-mod_rails-aka-passenger-phusion-on-dreamhost-ps</feedburner:origLink></entry>
  <entry>
    <author>
      <name>Tim Connor</name>
    </author>
    <id>urn:uuid:7df76bc7-494a-420e-a1df-2c30c96d9ffe</id>
    <published>2008-07-28T12:42:00-07:00</published>
    <updated>2008-10-14T15:54:37-07:00</updated>
    <title type="html">named_scope dependencies via returning anonymous scopes from class methods</title>
    <link href="http://feeds.feedburner.com/~r/timocracy/~3/348614846/named_scope-dependencies-via-returning-anonymous-scopes-from-class-methods" rel="alternate" type="text/html" />
    <category term="rails" scheme="http://www.timocracy.com/articles/category/rails" label="Rails" />
    <category term="named_scopes" scheme="http://www.timocracy.com/articles/tag/named_scopes" />
    <summary type="html">&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; This doesn&amp;#8217;t actually quite work, as it can override some scopes when composed.  I haven&amp;#8217;t quite figured out yet, if the technique is salvageable in some situations, or if it is always unsafe to use for chaining scopes.&lt;/p&gt;


	&lt;p&gt;I have not been able to find any info on ways to make &lt;a href="http://ryandaigle.com/articles/2008/3/24/what-s-new-in-edge-rails-has-finder-functionality"&gt;rails named_scopes&lt;/a&gt; call each other, or otherwise handle dependencies.  This can come up, for instance, if you have complex scopes that require joins.  You might have some scopes that share the same needed set of joins to be valid, and you would like to spin that join out to a separate scope, so they could share it.  Or it might be called from a has_many :through, where that join will already be valid, but alternatively called directly, where the qualified column name suddenly won&amp;#8217;t make sense (&amp;#8216;other_table.column_name&amp;#8217; will be incorrrect in the unjoined query).&lt;/p&gt;


	&lt;p&gt;The best solution I have found is to use a class method that returns an &lt;a href="http://railscasts.com/episodes/112"&gt;anonymous scope.&lt;/a&gt;  This is a contrived example that could be better handled through the has_many side of the relationship, but with sufficiently complex multi-level has_many :throughs you can easily come up with a situation where you want dependent named_scopes.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
class Book
  named_scope :author_join, :joins =&amp;gt; 'INNER JOIN authors ON books.author_id = authors.id, order =&amp;gt; 'authors.last_name, authors.first_name'
  named_scope :published, :conditions =&amp;gt; {:published =&amp;gt; true}

  def self.by_author_country(country_code)
    Book.author_join.scoped(:conditions =&amp;gt; ['authors.country_code = ?', country_code])
  end
end

#yes they are still composable
Book.by_author_country('EU').published
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Just beware that currently &lt;a href="http://blog.teksol.info/2008/5/26/why-are-activerecord-scopes-not-merged"&gt;scopes don&amp;#8217;t merge joins&lt;/a&gt;, so you can only have one joins per set of composed scopes.&lt;/p&gt;</summary>
    <content type="html">&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; This doesn&amp;#8217;t actually quite work, as it can override some scopes when composed.  I haven&amp;#8217;t quite figured out yet, if the technique is salvageable in some situations, or if it is always unsafe to use for chaining scopes.&lt;/p&gt;


	&lt;p&gt;I have not been able to find any info on ways to make &lt;a href="http://ryandaigle.com/articles/2008/3/24/what-s-new-in-edge-rails-has-finder-functionality"&gt;rails named_scopes&lt;/a&gt; call each other, or otherwise handle dependencies.  This can come up, for instance, if you have complex scopes that require joins.  You might have some scopes that share the same needed set of joins to be valid, and you would like to spin that join out to a separate scope, so they could share it.  Or it might be called from a has_many :through, where that join will already be valid, but alternatively called directly, where the qualified column name suddenly won&amp;#8217;t make sense (&amp;#8216;other_table.column_name&amp;#8217; will be incorrrect in the unjoined query).&lt;/p&gt;


	&lt;p&gt;The best solution I have found is to use a class method that returns an &lt;a href="http://railscasts.com/episodes/112"&gt;anonymous scope.&lt;/a&gt;  This is a contrived example that could be better handled through the has_many side of the relationship, but with sufficiently complex multi-level has_many :throughs you can easily come up with a situation where you want dependent named_scopes.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
class Book
  named_scope :author_join, :joins =&amp;gt; 'INNER JOIN authors ON books.author_id = authors.id, order =&amp;gt; 'authors.last_name, authors.first_name'
  named_scope :published, :conditions =&amp;gt; {:published =&amp;gt; true}

  def self.by_author_country(country_code)
    Book.author_join.scoped(:conditions =&amp;gt; ['authors.country_code = ?', country_code])
  end
end

#yes they are still composable
Book.by_author_country('EU').published
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Just beware that currently &lt;a href="http://blog.teksol.info/2008/5/26/why-are-activerecord-scopes-not-merged"&gt;scopes don&amp;#8217;t merge joins&lt;/a&gt;, so you can only have one joins per set of composed scopes.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/timocracy/~4/348614846" height="1" width="1"/&gt;</content>
  <feedburner:origLink>http://www.timocracy.com/articles/2008/07/28/named_scope-dependencies-via-returning-anonymous-scopes-from-class-methods</feedburner:origLink></entry>
  <entry><title type="text">Links for 2008-08-12 [del.icio.us]</title><link rel="alternate" type="text/html" href="http://feeds.feedburner.com/~r/timocracy/~3/363598153/timocratic" /><updated>2008-08-13T00:00:00-05:00</updated><id>http://del.icio.us/timocratic#2008-08-12</id><summary type="html">&lt;ul&gt;
&lt;li&gt;&lt;a href="http://tnr.com/story_print.html?id=264510ca-2170-49cd-bad5-a0be122ac1a9"&gt;Trading Places&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</summary><content type="html">&lt;ul&gt;
&lt;li&gt;&lt;a href="http://tnr.com/story_print.html?id=264510ca-2170-49cd-bad5-a0be122ac1a9"&gt;Trading Places&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;img src="http://feeds.feedburner.com/~r/timocracy/~4/363598153" height="1" width="1"/&gt;</content><feedburner:origLink>http://del.icio.us/timocratic#2008-08-12</feedburner:origLink></entry><entry>
    <author>
      <name>Tim Connor</name>
    </author>
    <id>urn:uuid:81ca1e55-266e-4855-be3c-f70cabec919a</id>
    <published>2008-07-24T15:00:00-07:00</published>
    <updated>2008-07-24T15:12:36-07:00</updated>
    <title type="html">Rails 2.1 and &amp;quot;RangeError: memory address is a recycled object&amp;quot; errors when running tests</title>
    <link href="http://feeds.feedburner.com/~r/timocracy/~3/344944507/rails-2-1-and-rangeerror-memory-address-is-a-recycled-object-errors-when-running-tests" rel="alternate" type="text/html" />
    <category term="rails" scheme="http://www.timocracy.com/articles/category/rails" label="Rails" />
    <category term="rails" scheme="http://www.timocracy.com/articles/tag/rails" />
    <category term="errors" scheme="http://www.timocracy.com/articles/tag/errors" />
    <category term="upgrading" scheme="http://www.timocracy.com/articles/tag/upgrading" />
    <summary type="html">If you are hitting mysterious warnings of the format: &amp;#8220;RangeError: 0&amp;#215;19ad692 is recycled object&amp;#8221; in your tests, after upgrading to Rails 2.1, it might be due to threading issues.  Just commenting out the line
&lt;pre&gt;&lt;code&gt;
require 'thread'
&lt;/code&gt;&lt;/pre&gt;
in a library at work, that will run without it, quieted the tests, so it&amp;#8217;s possible even just requiring it will cause problems in Rails 2.1 (using ruby 1.8.6 p114).

	&lt;p&gt;Which is odd, since thread is required at least one place in the AR code itself, and elsewhere in our app.  Maybe it&amp;#8217;s an interplay of a couple libraries together, such as the non-threadsafe &amp;#8216;aws/s3&amp;#8217; and thread?&lt;/p&gt;</summary>
    <content type="html">If you are hitting mysterious warnings of the format: &amp;#8220;RangeError: 0&amp;#215;19ad692 is recycled object&amp;#8221; in your tests, after upgrading to Rails 2.1, it might be due to threading issues.  Just commenting out the line
&lt;pre&gt;&lt;code&gt;
require 'thread'
&lt;/code&gt;&lt;/pre&gt;
in a library at work, that will run without it, quieted the tests, so it&amp;#8217;s possible even just requiring it will cause problems in Rails 2.1 (using ruby 1.8.6 p114).

	&lt;p&gt;Which is odd, since thread is required at least one place in the AR code itself, and elsewhere in our app.  Maybe it&amp;#8217;s an interplay of a couple libraries together, such as the non-threadsafe &amp;#8216;aws/s3&amp;#8217; and thread?&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/timocracy/~4/344944507" height="1" width="1"/&gt;</content>
  <feedburner:origLink>http://www.timocracy.com/articles/2008/07/24/rails-2-1-and-rangeerror-memory-address-is-a-recycled-object-errors-when-running-tests</feedburner:origLink></entry>
</feed>
