From: "Luke A. Kanies" Date: 2003-12-24T05:23:55+09:00 Subject: Re: RubyGems and dependencies On Wed, 24 Dec 2003, Joey Gibson wrote: > On Wed, 24 Dec 2003, Francis Hwang wrote: > > > 1. If I use RubyGems to document a dependency to another gem then am I > > correct in thinking it's not enough to simply have had that library > > installed -- I explicitly need that gem, right? I mean, Lafcadio > > depends on REXML and when I try to install the Lafcadio gem it tells > > me it can't find the REXML gem. REXML is already installed (I'm using > > Ruby 1.8 so it's part of the std library) but I'll need to install the > > REXML gem so that my Lafcadio gem will work, right? > > This is the situation I tried to point out at RubyConf that I'd seen with > RedHat's rpm package manager. Namely that if I've already installed a > piece of software, without using the package manager, what will happen > when I try to install something else that _does_ use the package manager? > I don't really know how to solve it unless you can fake out the package > manager (gem-thingy) or have the gem producer provide some sort of test > that the gem-thingy can use at install time to check for the existence of > a piece of software that was installed manually. Maybe a filename/pathname > that it can check for as a last resort if the gem for a needed something > isn't found. Isn't this a relatively straightforward 'require ' test? I don't know exactly how CPAN decides if a package is installed or not, but it has always seemed as though it does something along the lines of: perl -M if [ $? != 0]; then echo Missing pkg # blah blah fi This is certainly an easy thing to do in ruby: begin require '' rescue # give a warning, maybe try to install the lib, and then # redo this section, probably end Luke -- The Washington Bullets are changing their name. The owners no longer want their team's name to be associated with crime. So from now on the team will be known as The Bullets. -- Paul Harvey, quoting Argus Hamilton