From: Jim Freeze Date: 2005-03-04T14:06:08+09:00 Subject: Re: ruby gems, and the require problem (was Re: RAA Status & b) * Sam Roberts [2005-03-04 09:48:04 +0900]: > Or say I have: > > A - v 3, 4, 5 installed > B - a script I downloaded and run > B requires X, which needs A with version >=3 > -> I'll get version 5, right/ > B requires Y, which needs A with version <= 4 > -> It will die, right? > > So, now I trouble shoot... and uninstall A version 5. How did rubygems > help me? I could have done this without ruby gems! :>V For singular library version requirements, gems works fine. For multiple library version requirements, gems provides the capability to load different versions of a library, but still has the problem of the classes having the same names. I think this could be solved elegantly with selector namespaces, but they aren't here yet. Hmm, could a little discipline in module definition and usage help out here?. module V123 class Fred end end module V234 class Fred end versions = [] versions << require('fred', '123') # returns ref to module V123 versions << require('fred', '234') # returns ref to module V234 versions.each { |v| v::Fred.new } -- Jim Freeze Code Red. Code Ruby