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.

rake gems:install doesnt handle >= correctly

#3050
  config.gem 'a_gem', :version => ">= 1.2.3"

rake gems:install only installs the newest version of this gem if the requirement isnt already met.

if version 1.2.3 is installed but 1.2.6 is available nothing happens.
if i didnt want to always install the newest version i could use '=' instead of '>='.

Reported by Kane · August 13th, 2009 @ 08:04 PM

State: wontfix
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. Matt Jones
    Matt Jones

    There's not much we can do about this - all the selection of which gem to install is in RubyGems, we just shell out to 'gem install' to do the work. You may want to raise this issue on the RubyGems Trac.

    August 17th, 2009 @ 04:04 PM

  2. Kane
    Kane

    sorry for disappointing you but my rubygems (1.3.5) does the job right.
    i assume rails behaves different because the install routine checks if it is already installed with "installed?".

    August 17th, 2009 @ 04:30 PM

  3. x0f
    x0f

    RubyGems (1.3.5) works for me too, seems to be a rails problem, is somewhat awkward bevavior.

    October 14th, 2009 @ 11:34 PM

  4. Matt Jones
    Matt Jones
    • State changed from new to wontfix
    • Tag set to gems

    Looked at this again - it is a Rails thing. However, the existing behavior isn't wrong here; you're specifying that you'll take any version of some_gem >= Y, and you've got a version >= Y installed. gems:install assumes that things are cool if the specified dependencies are satisfied.

    Going further, changing this will mess up lots of deployment setups; it's not uncommon to see 'rake gems:install' in deploy scripts. Changing the behavior to "grab the most recent version that satisfies the requirement" will mean upgrading already-installed gems on deploy. Almost certainly NOT what is wanted in a production environment.

    It might be useful to have the functionality you're looking for as another command (maybe gems:upgrade?). But it doesn't seem like this would be a good change to make to gems:install.

    Marking as 'wontfix'; I'll reopen if somebody comes up with a patch to add gems:upgrade.

    October 15th, 2009 @ 12:28 AM