Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Problem with gem dependency detection of frozen gems

#527

There is a problem with gem dependency in rails 2.1 and head.

If you specify your gem dependency with a <= or >= version string, the gem dependency won't detect if you have a frozen gem that isn't the specified version even if it satisfies the requirement.

Example:

config.gem "ruby-openid", :lib => "openid", :version => ">=2.0.4"

If you have ruby-openid-2.1.2 installed and type rake gems:unpack it'll freeze in vendor/gems.

However if you type rake:gems afterwards, it'll tell that it is installed and not frozen because it is looking for it under vendor/gems/ruby-openid-2.0.4 instead of vendor/gems/ruby-openid-2.1.2

What the patch does is:

Search vendor/gems for gems that match the required gem name and satisfy the required version. If more than one matching gem is found, the gem with the biggest version number is loaded.

Reported by Tiago Macedo · July 1st, 2008 @ 06:12 PM

State: resolved
Milestone: 2.x
Assigned to: Matt Jones Matt Jones
Importance: none

Activity

  1. Tiago Macedo
    Tiago Macedo

    I didn't write any tests because this is only verifiable with frozen gems.

    July 1st, 2008 @ 06:13 PM

  2. Lee Marlow
    Lee Marlow

    +1

    This patch correctly detects my unpacked gems when using the ~> gem requirement syntax.

    July 10th, 2008 @ 06:58 PM

  3. Lee Marlow
    Lee Marlow

    Modified the patch to not depend on ActiveSupport's String#starts_with? method

    This allows starting the server via mongrel_rails, etc. instead of just through script/server

    July 17th, 2008 @ 11:21 PM

  4. Pratik
    Pratik
    • Assigned user set to Rick

    July 18th, 2008 @ 12:01 AM

  5. Matt Jones
    Matt Jones
    • State changed from new to resolved
    • Assigned user changed from Rick to Matt Jones

    This shouldn't be an issue with the current gem code (as of 2.2.2) - please reopen if it is.

    February 18th, 2009 @ 01:23 AM