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.

Rails incorrectly imposes version number as last part of gem directory name

#4295

Rails requires that gems have a number as the last part of the filename, so many windows gems can't be frozen since the platform string is the last part of the gem name (and directory name)

version_for_dir in VendorGemSourceIndex makes this assumption, as does from_directory_name in GemDependency.

The monkey patch is kind of a pain, as you have to load the patch from two different places in boot.rb.

Reported by Chris Ochs · March 29th, 2010 @ 07:05 PM

State: resolved
Milestone: 2.3.10
Assigned to: José Valim José Valim
Importance: Low

Activity

  1. Chris Ochs
    Chris Ochs

    Correction, this only applies to frozen gems.

    March 29th, 2010 @ 07:06 PM

  2. Yehuda Katz (wycats)
  3. Rizwan Reza
  4. Colin Casey
  5. Colin Casey
    Colin Casey
    • Tag changed from bugmash to bugmash, bugmash-patch, bugmash-review

    Also, I've attached a patch. This patch contains both the test case and the fix so the above patch is unnecessary.

    May 17th, 2010 @ 03:05 AM

  6. Jeff Kreeftmeijer
    Jeff Kreeftmeijer

    +1

    Applies cleanly to 2-3-stable, tests pass. :)

    May 17th, 2010 @ 02:54 PM

  7. Jeremy Kemper
    Jeremy Kemper
    • Milestone changed from 2.3.6 to 2.3.7

    May 23rd, 2010 @ 05:54 PM

  8. Jeremy Kemper
    Jeremy Kemper
    • Milestone changed from 2.3.7 to 2.3.8

    May 24th, 2010 @ 09:40 AM

  9. Jeremy Kemper
    Jeremy Kemper
    • Milestone changed from 2.3.8 to 2.3.9

    May 25th, 2010 @ 11:45 PM

  10. Ben Oakes
    Ben Oakes

    I'm having the same problem, but it took me a little while to find this ticket. The error message I'm getting is:

    Malformed version number string mswin32 (ArgumentError)
    

    Hopefully that makes the ticket easier to search for. :) I had also written up steps to reproduce the bug, which I'm including just for reference:

    rails gem_bug_sandbox
    cd gem_bug_sandbox
    vim config\environment.rb
    # # Add a gem with native extensions, such as nokogiri 1.4.2:
    # config.gem 'nokogiri', :version => '1.4.2'
    rake gems:install
    rake gems:unpack
    

    To get the error message:

    ruby script\server
    => Booting WEBrick
    => Rails 2.3.5 application starting on http://0.0.0.0:3000
    C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/version.rb:107:in `initialize': Malformed version number string mswin32 (ArgumentError)
    

    In the meantime, I'm just not unpacking the problem gems. It's not ideal, but it works.

    May 26th, 2010 @ 07:46 PM

  11. Rizwan Reza
    Rizwan Reza
    • Tag changed from bugmash, bugmash-patch, bugmash-review to bugmash-review
    • State changed from new to verified

    June 13th, 2010 @ 08:16 PM

  12. Jeremy Kemper
    Jeremy Kemper
    • Milestone changed from 2.3.9 to 2.3.10
    • Importance changed from to Low

    August 30th, 2010 @ 02:28 AM

  13. David Trasbo
    David Trasbo
    • Assigned user set to José Valim

    This patch should really be applied. Perhaps mr. Valim will take care of it?

    September 23rd, 2010 @ 10:52 AM

  14. Repository
    Repository
    • State changed from verified to resolved

    (from [f2990620d716146064d9d2f88ac487025d4b031a]) Test for imposed version number as last part of gem directory name for frozen gems

    [#4295 state:resolved]

    Signed-off-by: José Valim jose.valim@gmail.com
    http://github.com/rails/rails/commit/f2990620d716146064d9d2f88ac487...

    September 24th, 2010 @ 12:18 PM

  15. Ben Oakes
    Ben Oakes

    Just curious: how relevant is this ticket with Bundler now being the new hotness? (Does the fix mainly affect Rails 2?)

    September 30th, 2010 @ 12:02 PM

  16. David Trasbo
    David Trasbo

    Ben,

    Actually this change exclusively affects Rails 2.3.x. Rails 2 is maintained even now when Rails 3 is out.

    September 30th, 2010 @ 03:51 PM

  17. Ben Oakes
    Ben Oakes

    David,

    Good to know. Thanks.

    September 30th, 2010 @ 05:00 PM