Versioning conflict issue with dependencies of dependency

William Lee's Avatar

William Lee

28 Sep, 2010 06:25 PM

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

  1. 2 Posted by William Lee on 01 Oct, 2010 02:13 PM

    William Lee's Avatar

    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.

  2. Support Staff 3 Posted by Nick Quaranto on 03 Oct, 2010 05:13 PM

    Nick Quaranto's Avatar

    Ugh :/ Is happening with Bundler or just straight installing gems?

  3. 4 Posted by William Lee on 04 Oct, 2010 02:33 PM

    William Lee's Avatar

    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.

  4. 5 Posted by William Lee on 04 Oct, 2010 03:13 PM

    William Lee's Avatar

    Edit for more clarification: Above post should read:

    "but continous to install activesupport 3.0.0 and its dependencies"

  5. Support Staff 6 Posted by Nick Quaranto on 22 Oct, 2010 12:27 AM

    Nick Quaranto's Avatar

    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

  6. Nick Quaranto closed this discussion on 22 Oct, 2010 12:27 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac