From: Chad Fowler Date: 2005-06-19T05:10:54+09:00 Subject: Re: Confusion about gems and non-gems working together. Hi Lloyd! On 6/17/05, Lloyd Zusman wrote: > Ever since I started installing packages via the gems mechanism, I have > kept running into problems that few others seemed to have (or at least > mention here). More often than I would like, a gem installation would > either fail outright, or else it would get installed but not work > properly, yielding errors that seemed to be non-reproducible by others. > > I now think that I might have figured out what is going on for me: > > In all the cases where I had these problems, I had non-gem installs of > earlier versions of the packages. In many cases, it seems like code > inside of files associated with these earlier versions would get > executed instead of the code that the newer gem would use. > > I have a standard ruby installation with no special path settings, and > yet, I still am getting these unwanted interactions between certain gems > and their older, non-gem counterparts. > > Has anyone else experienced anything like this? If so, how did you > handle it? > I haven't, but I don't use non-gem libs much anymore. Could you give a specific example? I think it might be instructive. As long as the gem version of the library is before the non-gem version in the load path (which it should be), you should get the gem version of the lib. Since that's obviously not the way it's working for you, it would be great to hear some specifics. > I presume that when I install a gem, I should completely uninstall any > older, non-gem versions of the same package. What is the accepted way > to uninstall a package? Do I just go into the ruby tree and delete all > files and directories associated with the non-gem? If so, how can I > find out what is the exhaustive list of files and directories to remove > for a given package? > That's part of the problem pre-gems. There's no nice, repeatable way to do this. If you've got the original tar file lying around, you can look at it's contents and remove files that seem to have been installed by it. Even then, you'll probably want to use a checksum of some sort just in case installations of later libs over wrote files of the same name (which you might still be depending on). > This brings up a suggestion: could the gem installer check for > previously installed non-gem versions of the package in question, and > then ask the user if he/she wants to optionally delete them as part of > the gem install? Something like that would be massively useful, IMHO. > I'll add it to our list. It would be hard to do cleanly and reliably, but as an optional user-verifiable setting, it wouldn't be too terribly evil. > > -- > Lloyd Zusman > ljz@asfast.com > God bless you. > > > -- Chad Fowler http://chadfowler.com http://rubycentral.org http://rubygarden.org http://rubygems.rubyforge.org (over 300,000 gems served!)