Versioning conflict issue with dependencies of dependency
Hi guys, I'm totally new to ruby and rubygems, and its my first time here too, please kindly be patience with me..:)
We are currently encountering a very interesting issue and would like to gather some inputs and comments from the group. Basically, this is what happened:
On my system I have activerecord 2.3.x installed, and when I tried to install a gem with dependency: activerecord (>=1.15.1), rubygems will first fetch down the "latest" activerecord "3.0.0" specification, and then althought it will not install the latest activerecord (because I already the one on my system already satisfies the dependency requirement), rubygems will continue, recusively, fetch down and install all the dependency gems of "3.0.0".
And that create some versoining conflict issue since one of the dependencies of the new activerecord "3.0.0" is not compatible with rubygems 1.3.5.
My question is, if rubygems smart enough to detect and not install the "latest" version of a dependency, why it continue to fetch the dependencies of the "latest" version of that dependency and install them? Shouldn't it use the spec from the "installed" version instead when determine the dependency?
In my imagination, I can think of a situation like this: assuming Gem A depends on Gem X as follows:
Gem X (version 1.0) depends on Gem Y (version 1.0), and Gem X (verson 2.0) depends on Gem Y (versoin 2.0), and the current behavior will causing my system to have Gem X (v1.0) and Gem Y (v2.0) after installing Gem A, and no one can guarantee they are compatible...
Or maybe I misunderstand the rubygems's dependency mechanism?
Thanks in advance for all your help.
William
Comments are currently closed for this discussion. You can start a new one.
2 Posted by William Lee on 01 Oct, 2010 02:13 PM
Seems like RG always use the latest spec to determine the dependencies regardless of what installed on the system, and that causes all the issues.
Support Staff 3 Posted by Nick Quaranto on 03 Oct, 2010 05:13 PM
Ugh :/ Is happening with Bundler or just straight installing gems?
4 Posted by William Lee on 04 Oct, 2010 02:33 PM
It happens with straight installing gems. The simpliest way to see the issue is to install activerecord 2.3.5, then install ibm_db 2.0.0, and you will see RG skip activerecord 3.0.0 (since 2.3.5 satisfies ibm_db requirement), but continous to install activerecord 3.0.0 dependencies.
5 Posted by William Lee on 04 Oct, 2010 03:13 PM
Edit for more clarification: Above post should read:
"but continous to install activesupport 3.0.0 and its dependencies"
Support Staff 6 Posted by Nick Quaranto on 22 Oct, 2010 12:27 AM
I think the best thing here is to just use Bundler...it was made for this problem specifically. There's plenty of docs here:
http://gembundler.com
Nick Quaranto closed this discussion on 22 Oct, 2010 12:27 AM.