<?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>Geoff Evason &#187; 2.3.2</title>
	<atom:link href="http://geoff.evason.name/tag/2-3-2/feed/" rel="self" type="application/rss+xml" />
	<link>http://geoff.evason.name</link>
	<description></description>
	<lastBuildDate>Wed, 30 Nov 2011 03:41:06 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Upgrading from Rails 2.2.2 to Rails 2.3.2</title>
		<link>http://geoff.evason.name/2009/05/04/upgrading-from-rails-222-to-rails-232/</link>
		<comments>http://geoff.evason.name/2009/05/04/upgrading-from-rails-222-to-rails-232/#comments</comments>
		<pubDate>Mon, 04 May 2009 11:32:44 +0000</pubDate>
		<dc:creator>Geoff</dc:creator>
				<category><![CDATA[tech]]></category>
		<category><![CDATA[2.3.2]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[upgrade]]></category>

		<guid isPermaLink="false">http://geoff.evason.name/?p=67</guid>
		<description><![CDATA[I recently upgraded one of my apps from Rails 2.2.2 to Rails 2.3.2.  It was actually a really easy upgrade, but there were  few little gotchas I had to watch out for, so I thought I&#8217;d share my experience.
Upgrading Rails
I imagine there is probably a better way to do this, but since I [...]]]></description>
			<content:encoded><![CDATA[<p>I recently upgraded one of my apps from Rails 2.2.2 to Rails 2.3.2.  It was actually a really easy upgrade, but there were  few little gotchas I had to watch out for, so I thought I&#8217;d share my experience.</p>
<p><strong>Upgrading Rails</strong></p>
<p>I imagine there is probably a better way to do this, but since I change the version of rails so infrequently I&#8217;m not sure.  (If there is a better way, please let me know). My flow is as follows:</p>
<p>Install the new version of the rails gems:</p>
<pre><code>
sudo gem install rails
</code></pre>
<p>Branch your app</p>
<pre><code>
git branch newrails
git co newrails
</code></pre>
<p>Remove the old version of frozen gems</p>
<pre><code>
git rm -rf vendor/rails
</code></pre>
<p>Update your config/environment.rb file to the new version of rails:</p>
<pre><code class='ruby'>
RAILS_GEM_VERSION = '2.3.2' unless defined? RAILS_GEM_VERSION
</code></pre>
<p>freeze the new gems</p>
<pre><code>
rake rails:freeze:gems
</code></pre>
<p>Please note, that if instead of installing the new gems and freezing them from your local gems, it looks as though you need to be careful if using rake rails:freeze:gems.  You can read more about it in the <a href="http://weblog.rubyonrails.org/2009/3/20/this-week-in-edge-rails" title="rails 2.3.2.1">official post</a> or in <a href="http://afreshcup.com/2009/03/18/rails-2321/" title="rails 2.3.2.1">this post</a> which I found more understandable.</p>
<p><strong>Testing Your App</strong></p>
<p>The first and most obvious error you will run into is this:</p>
<pre><code class='ruby'>
uninitialized constant ApplicationController
</code></pre>
<p>This is because as of <a href="http://guides.rubyonrails.org/2_3_release_notes.html#application-controller-renamed">Rails 2.3 application.rb is now application_controller.rb</a>.  To fix this just do</p>
<pre><code>
git mv app/controllers/application.rb app/controllers/application_controller.rb
</code></pre>
<p>The next error I got was</p>
<pre><code>
undefined method `relative_url_root' for #<actionController::Request:0x373adf4>
</code></pre>
<p>I narrowed this down to a stylesheet_link_tag call.  I got around this by updating the <a href="http://synthesis.sbecker.net/pages/asset_packager" title="asset packager">asset_packager</a> plugin, and updating HAML to 2.0.9.  By the way, if you&#8217;re not using asset packager, you should be.</p>
<p>That&#8217;s it!  It overall was a very easy upgrade that took much less time to test than my <a href="http://geoff.evason.name/2009/01/15/upgrading-an-app-from-rails-21-to-rails-222/">rails 2.1 to rails 2.2.2 upgrade</a>.</p>
<p>Here are <a href="http://giantrobots.thoughtbot.com/2009/4/15/rails-2-3-2-upgrade-gotchas">some other rails 2.3 gotchas</a> to watch out for courtesy of thoughtbot.</p>
]]></content:encoded>
			<wfw:commentRss>http://geoff.evason.name/2009/05/04/upgrading-from-rails-222-to-rails-232/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

