<?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>Rails vs Whitewater &#187; Frustration</title>
	<atom:link href="http://justinspowers.com/category/frustration/feed/" rel="self" type="application/rss+xml" />
	<link>http://justinspowers.com</link>
	<description>Whitewater enthusiast by day, Ruby on Rails programmer by night.</description>
	<lastBuildDate>Sat, 10 Dec 2011 07:42:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Improve your day in one line of code or less</title>
		<link>http://justinspowers.com/2009/04/improve-your-day-in-one-line-of-code-or-less/</link>
		<comments>http://justinspowers.com/2009/04/improve-your-day-in-one-line-of-code-or-less/#comments</comments>
		<pubDate>Mon, 20 Apr 2009 16:41:00 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[Capistrano]]></category>
		<category><![CDATA[Efficiency]]></category>
		<category><![CDATA[Frustration]]></category>
		<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://justinspowers.com/?p=4</guid>
		<description><![CDATA[I&#8217;ve been dealing the past two weeks with getting photify.net production ready.  A lot of that time has been spent on site working with the end users and business owners.  Developing in that kind of environment means pushing fixes and updates out fast and furious, and bringing them into the production environment as fast as possible. [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been dealing the past two weeks with getting <a href="http://photify.net/" onclick="pageTracker._trackPageview('/outgoing/photify.net/?referer=');">photify.net</a> production ready.  A lot of that time has been spent on site working with the end users and business owners.  Developing in that kind of environment means pushing fixes and updates out fast and furious, and bringing them into the production environment as fast as possible.</p>
<p>To give you a little bit of background on my setup, I am using Capistrano to deploy to two servers, both of which are running Phusion Passenger.  One server is on a shared host, along with the SVN repository, and the second server is inside of a private network with a sub-optimal internet connection.  Both servers share a common database.  I ran into an issue running &#8220;cap deploy&#8221;, because it was trying to copy the entire application over ssh to both servers every time.  This wasn&#8217;t a large issue for the shared host, but the server in the private network would keep hanging after it got past a certain point.  This all took me days to figure out, because capistrano give very minimal debugging/logging information, and the error messages changed every time, usually letting me know that the I/O stream had closed.</p>
<p>I first set this scenario up using the Agile Development with RoR book, but since I was using an outdated PDF, turns out I wasn&#8217;t using the optimal setup.  Originally, the book called for the following line in my config/deploy.rb file:</p>
<p><code>set :deploy_via, :export</code></p>
<p>The idea here is that you want to export the project from the SVN repository,  but leave behind all the unnecessary subversion .svn junk.  Seemed reasonable enough to me.  However, in the updated PDF, they made a subtle, but gamechanging alteration:</p>
<p><code>set :deploy_via, :remote_cache</code></p>
<p>What this does, is it actually checks out a version of your project into shared/cached-copy on the target server(s), and going forward only runs an SVN update command, which only updates the files that have been changed.  Capistrano then uses this copy to deploy your code the same as before.</p>
<p>It seems like the obvious choice, and now that I know where to look, there is plenty of information about it.  But if you are stuck waiting for an hour for cap deploy to finish, or are getting random errors, it&#8217;s hard to find an answer online.  In my case, I actually manually checked out my code into the shared/cached-copy directory on both servers, as I was tired of capistrano screwing it up.  Once I got the initial code in there, further cap deploy&#8217;s take only 1 minute or so, compared to 30+ minutes previously.  Sweet!</p>
]]></content:encoded>
			<wfw:commentRss>http://justinspowers.com/2009/04/improve-your-day-in-one-line-of-code-or-less/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

