<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Segment7: My Favorite gem Commands</title>
    <link>http://blog.segment7.net/articles/2007/12/23/my-favorite-gem-commands</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>The Blog</description>
    <item>
      <title>My Favorite gem Commands</title>
      <description>&lt;p&gt;My two favorite gem commands are &lt;kbd&gt;gem install -i ~/tmp/gems&lt;/kbd&gt; and &lt;kbd&gt;gem which&lt;/kbd&gt;, followed closely by the &lt;kbd&gt;gem fetch gemname; gem unpack gemname&lt;/kbd&gt; combo.

&lt;p&gt;Now that the install command automatically installs all the necessary dependencies into the installation directory, it's easy to pull down a gem and play with it without having to do the work of cleaning out all it's dependencies from your main repository.  A simple &lt;kbd&gt;rm -r ~/tmp/gems&lt;/kbd&gt; is all it takes to clean up.

&lt;p&gt;While I seldom have a need to use it, &lt;kbd&gt;gem which&lt;/kbd&gt; tells you which file would get loaded when you require something.  For example:

&lt;pre&gt;&lt;samp&gt;$ gem list activerecord

*** LOCAL GEMS ***

activerecord (1.15.6, 1.15.3)

$ gem which active_record
(checking gem activerecord-1.15.6 for active_record)
/System/Library/Frameworks/[...]/gems/activerecord-1.15.6/lib/active_record.rb&lt;/samp&gt;&lt;/pre&gt;

&lt;p&gt;Finally, if I just want to poke at some code from a gem without bothering to poke through a gem repository, you can use &lt;kbd&gt;gem fetch gemname; gem unpack gemname&lt;/kbd&gt; and you'll have a gemname-version directory with the gem sitting right in front of you.
</description>
      <pubDate>Sun, 23 Dec 2007 19:14:00 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:4fbe1377-faf4-405a-8575-b2fed1d3ee54</guid>
      <author>drbrain@segment7.net (Eric Hodel)</author>
      <link>http://blog.segment7.net/articles/2007/12/23/my-favorite-gem-commands</link>
      <category>Rubygems</category>
    </item>
  </channel>
</rss>
