<?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>Talk Like A Duck: Tag rake</title>
    <link>http://talklikeaduck.denhaven2.com/articles/tag/rake</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>In Ruby, it's not the dog, it's the tricks!</description>
    <item>
      <title>Rails rake_freeze_other_gems</title>
      <description>I&amp;#8217;m working on a team rails project and adding some timezone support.  I installed the tzinfo gem and, since I want to make sure that it gets to the production server, I used the freeze_other_gems&lt;/a&gt; rake task, which I&amp;#8217;d found by doing a rake -T.
&lt;p&gt;I&amp;#8217;d never used it before so I googled to find &lt;a href="http://nubyonrails.com/articles/freeze-other-gems-to-rails-lib-directory"&gt;some documentation&lt;/a&gt;.
It wasn&amp;#8217;t exactly clear, but it turns out that you need to edit the fourth line of the lib/tasks/gems.rake file
&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;libraries = %w(progressbar tzinfo)&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The progressbar gem was already there so I added tzinfo.&lt;/p&gt;
&lt;p&gt;Then I invoked:&lt;/p&gt;
&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;$ rake freeze_other_gems&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Only to get the error:&lt;/p&gt;
&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;rake aborted! undefined method `version&#8217; for nil:NilClass&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This problem had been seen by others and commented on.  I guessed that the problem was not with my newly added gem, but the progressbar gem which was already listed, apparently by one of the other developers.&lt;/p&gt;
&lt;h2&gt;The Quick Fix&lt;/h2&gt;
The first step was to determine the version of the progressbar gem.  I looked at lib where it had been installed, and found that it was version 0.3.  I then installed the gem, and reran the freeze_other_gems rake task.
&lt;p&gt;Success&lt;/p&gt;</description>
      <pubDate>Mon, 02 Jul 2007 11:36:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:0834c8f1-be40-4b93-8aa4-6af82d2a1b77</guid>
      <author>Rick DeNatale</author>
      <link>http://talklikeaduck.denhaven2.com/articles/2007/07/02/rails-rake_freeze_other_gems</link>
      <category>rails</category>
      <category>rake</category>
      <category>rails</category>
      <category>gems</category>
      <trackback:ping>http://talklikeaduck.denhaven2.com/articles/trackback/439</trackback:ping>
    </item>
  </channel>
</rss>
