<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="/stylesheets/rss.css" type="text/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>OnRails.org: Tag fowler</title>
    <link>http://onrails.org/articles/tag/fowler?tag=fowler</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Ruby On Rails and related matters.</description>
    <item>
      <title>Fowler on RubyGems</title>
      <description>&lt;p&gt;Since Daniel came back from Europe, I figured I&amp;#8217;d finally pick up his slack and write an entry. :)
&lt;/p&gt;
&lt;hr /&gt;

&lt;p&gt;Last night I went to the &lt;a href="http://rubyforge.org/projects/bdrg/"&gt;Boulder-Denver Ruby Group&lt;/a&gt; where Chad Fowler spoke about all things &lt;a href="http://docs.rubygems.org/"&gt;RubyGems&lt;/a&gt;.  It was a laid back talk with a recap of gems past, present and future.  Pre-RubyConf 2003 the ruby-talk list would get peppered with questions like &lt;quote&gt;&amp;#8220;Where is Ruby&amp;#8217;s &lt;span class="caps"&gt;CPAN&lt;/span&gt;?&amp;#8221;&lt;/quote&gt;  At RubyConf 2003, when put on the spot by &lt;a href="http://dablog.rubypal.com/"&gt;David A. Black&lt;/a&gt; about the topic, &lt;a href="http://en.wikipedia.org/wiki/Yukihiro_Matsumoto"&gt;Matz&lt;/a&gt; basically said &lt;quote&gt;&amp;#8220;if you build it, it will be included in ruby core.&lt;/quote&gt;  That led &lt;a href="http://www.onestepback.org/"&gt;Jim Weirich&lt;/a&gt;, &lt;a href="http://richkilmer.blogs.com/"&gt;Rich Kilmer&lt;/a&gt;, Black, and Fowler to spend the next night coding what would become the RubyGems.  They even demo-ed it at the conference.  It has grown quite a bit since then and now could be called the de facto standard for library distribution in Ruby.
&lt;/p&gt;

&lt;p&gt;The latest version of RubyGems is 0.9.0, which has some not so minor scalability improvements.  To get the latest version simple run &lt;code&gt;gem update --system&lt;/code&gt;.  Since RubyGems isn&amp;#8217;t in core yet, you still need to &lt;code&gt;require 'rubygems'&lt;/code&gt; or set your &lt;code&gt;RUBYOPT&lt;/code&gt; environment variable to &lt;code&gt;rubygems&lt;/code&gt;.  There is another way when starting ruby you can pass it the &lt;code&gt;-rubygems&lt;/code&gt; argument.  &lt;quote&gt;&amp;#8220;But you said it wasn&amp;#8217;t in &lt;em&gt;core&lt;/em&gt;... if it&amp;#8217;s not in core, why does it have it&amp;#8217;s own argument for the ruby interpreter?&amp;#8221;&amp;#8220;&lt;/quote&gt;  It&amp;#8217;s true, it&amp;#8217;s not in core.  This is actually just a little trick by Chad et al to make it look it is part of ruby.  The &lt;code&gt;-r&lt;/code&gt; argument tell ruby to require whatever parameter follows, so the gem crowd made an &lt;code&gt;ubygems.rb&lt;/code&gt; file that only has one line of code in it &amp;#8230; &lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_ruby "&gt;&lt;span class="ident"&gt;require&lt;/span&gt; &lt;span class="punct"&gt;'&lt;/span&gt;&lt;span class="string"&gt;rubygems&lt;/span&gt;&lt;span class="punct"&gt;'&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt; ... and from that comes &lt;code&gt;ruby -rubygems&lt;/code&gt;.
&lt;/p&gt;

&lt;p&gt;Bundled with gems is its own &lt;code&gt;gem_server&lt;/code&gt;.  Firing this up starts up a WebBrick server on port 8808 by default.  Going to &lt;a href="http://localhost:8808"&gt;http://localhost:8808&lt;/a&gt; will then display all of the gems you have installed and even link to the rdoc installed locally if it exists and to the docs on the web.  It also can serve gems if you wish.  This means other machines could point to your gem_server and install any of the gems that you have installed.  You do this with the &lt;code&gt;--source&lt;/code&gt; argument.  Others could search what gems you have by running &lt;code&gt;gem search -r --source http://your_machine:8808 search_string&lt;/code&gt;.  There is even a tool &lt;code&gt;index_gem_repository.rb&lt;/code&gt; that will create a directory that can be served by apache as a gem server, in case you want something a little beefier than webrick.
&lt;/p&gt;

&lt;p&gt;One interesting idea that Chad mentioned was making a meta-gem for your projects.  All the gem would declare is its dependencies on the other gems that your project needs.  That way when setting up a new machine you can just install your meta-gem from your gem_server and then it will automatically install all the necessary gems.  &lt;strong&gt;Pretty cool.&lt;/strong&gt;
&lt;/p&gt;

&lt;p&gt;Chad did a good job of describing how gems came to be and guiding us through some of the code with some nice anecdotes along the way.
&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;P.S.  The coolest part of the night was I&amp;#8217;m going to be a volunteer at RubyConf `06!  Chad was quick to warn me that there is no glamour involved.  Oh well, I&amp;#8217;m excited anyway.&lt;/p&gt;</description>
      <pubDate>Thu, 20 Jul 2006 21:05:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:c1f0f927-8638-4e27-8edf-f28df8409c7d</guid>
      <author>Lee Marlow</author>
      <link>http://onrails.org/articles/2006/07/20/fowler-on-rubygems</link>
      <category>Ruby</category>
      <category>rubyconf</category>
      <category>fowler</category>
      <category>chad</category>
      <category>rubygems</category>
      <category>ruby</category>
    </item>
  </channel>
</rss>
