<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: rubygems code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Fri, 29 Aug 2008 23:35:11 GMT</pubDate>
    <description>DZone Snippets: rubygems code</description>
    <item>
      <title>Upgrade rubygems and/or specific gems themselves via capistrano</title>
      <link>http://snippets.dzone.com/posts/show/4905</link>
      <description>When a latest RubyGems is released (e.g. 0.9.5 recently) or Rails (e.g. 2.0.2) you might want to push those upgrades to all your production machines.&lt;br /&gt;&lt;br /&gt;Add these two tasks to your deploy.rb capistrano file (add namespaces for cap2.0 if you like)&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;  desc "Updates RubyGems version"&lt;br /&gt;  task :gem_update_system do&lt;br /&gt;    sudo "gem update --system"&lt;br /&gt;  end&lt;br /&gt;&lt;br /&gt;    &lt;br /&gt;  desc "Install a RubyGem from remote source"&lt;br /&gt;  task :gem_install do&lt;br /&gt;    puts "USAGE: GEM=gemname cap gems_install" and next unless ENV['GEM']&lt;br /&gt;    sudo "gem install #{ENV['GEM']} --no-ri --no-rdoc"&lt;br /&gt;  end&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;To upgrade rubygems and rails, for example:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;cap gem_update_system&lt;br /&gt;GEM=rails cap gem_install&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;</description>
      <pubDate>Wed, 19 Dec 2007 22:10:32 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/4905</guid>
      <author>nicwilliams (Dr Nic Williams)</author>
    </item>
  </channel>
</rss>
