<?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>Lasse Bunk&#039;s weblog &#187; Rake</title>
	<atom:link href="http://lassebunk.dk/tag/rake/feed/" rel="self" type="application/rss+xml" />
	<link>http://lassebunk.dk</link>
	<description>(Sorry, I don&#039;t have a tagline.)</description>
	<lastBuildDate>Wed, 01 Sep 2010 20:21:33 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Deploying gems using Capistrano</title>
		<link>http://lassebunk.dk/2009/07/18/deploying-gems-using-capistrano/</link>
		<comments>http://lassebunk.dk/2009/07/18/deploying-gems-using-capistrano/#comments</comments>
		<pubDate>Sat, 18 Jul 2009 17:19:32 +0000</pubDate>
		<dc:creator>lassebunk</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Capistrano]]></category>
		<category><![CDATA[Gems]]></category>
		<category><![CDATA[Rake]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://lassebunk.dk/?p=137</guid>
		<description><![CDATA[Update for Rails 3: Rails 3 and Bundler: Deploying gems using Capistrano
Thought I&#8217;d share this because I had a lot of trouble figuring out how and where to run the &#8220;rake gems:install&#8221; when deploying with Capistrano. I wanted it to automatically deploy the gems when I call &#8220;cap deploy:migrations&#8221; &#8211; this is done by installing [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update for Rails 3:</strong> <a href="http://lassebunk.dk/2010/09/01/rails-3-bundler-gems-capistrano/">Rails 3 and Bundler: Deploying gems using Capistrano</a></p>
<p>Thought I&#8217;d share this because I had a lot of trouble figuring out how and where to run the <a href="http://ryandaigle.com/articles/2008/4/1/what-s-new-in-edge-rails-gem-dependencies">&#8220;rake gems:install&#8221;</a> when deploying with <a href="http://www.capify.org">Capistrano</a>. I wanted it to automatically deploy the gems when I call &#8220;cap deploy:migrations&#8221; &#8211; this is done by installing the gems right after update_code, like this:</p>
<pre class="brush: ruby;">
# config/deploy.rb
after &quot;deploy:update_code&quot;, &quot;gems:install&quot;

namespace :gems do
  desc &quot;Install gems&quot;
  task :install, :roles =&gt; :app do
    run &quot;cd #{current_release} &amp;&amp; #{sudo} rake gems:install&quot;
  end
end
</pre>
<p>Some of the examples I&#8217;ve seen use &#8220;cd #{current_path}&#8221; but I don&#8217;t think this would work as the &#8220;current&#8221; symlink hasn&#8217;t been updated at the time the &#8220;update_code&#8221; task is run. That&#8217;s why I use &#8220;current_release&#8221;.</p>
<p>Also others use &#8220;rake RAILS_ENV=production gems:install&#8221; but I can&#8217;t see why you should have to use RAILS_ENV here. If I&#8217;m wrong, please correct me.</p>
<p>Some of the links I found when trying to get this to work:</p>
<ul>
<li><a href="http://capitate.rubyforge.org/recipes/deploy.html">Capistrano recipes: deploy</a></li>
<li><a href="http://henrik.nyh.se/2008/10/cap-gems-install-and-a-gem-dependency-gotcha">cap gems:install and a Gem dependency gotcha</a></li>
<li><a href="http://new.teabass.com/posts/install-required-gems-remotely-with-capistrano">Install required gems remotely with capistrano</a></li>
<li><a href="http://github.com/jamis/capistrano/blob/df0935c4c135207582da343aacdd4cf080fcfed0/lib/capistrano/recipes/deploy.rb">lib/capistrano/recipes/deploy.rb</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://lassebunk.dk/2009/07/18/deploying-gems-using-capistrano/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
