How to change platform of existing gem

David Colebatch's Avatar

David Colebatch

16 Apr, 2012 03:49 PM

We have a gem on where the platform was recently fixed from being 'jruby' (incorrect) to 'java' (correct!)


Now, only the most recent gem has the correct platform. What is the best way to fix the older versions of the gem to have the correct platform? They are currently unusable by the latest version of bundler as it's (now) validating the gemspec prior to installation.


  1. Support Staff 1 Posted by Evan Phoenix on 16 Apr, 2012 05:08 PM

    Evan Phoenix's Avatar

    I suggest you yank those older versions. We don't support the ability to change the platform of a gem.

  2. Evan Phoenix closed this discussion on 16 Apr, 2012 05:08 PM.

  3. Luis Lavena re-opened this discussion on 16 Apr, 2012 05:09 PM

  4. 2 Posted by Luis Lavena on 16 Apr, 2012 05:09 PM

    Luis Lavena's Avatar

    Short answer: you can't

    Long answer: gems were automatically downloaded by mirrors and also downloaded by users. You can't push gems over existing ones because downloaded won't equal cached and you can evict cached gems for end-user systems.

    Once a gem has been pushed, was pushed.

    If you want to avoid a gem from being installed, you can yank it.

  5. Luis Lavena closed this discussion on 16 Apr, 2012 05:16 PM.

  6. David Colebatch re-opened this discussion on 16 Apr, 2012 06:29 PM

  7. 3 Posted by David Colebatch on 16 Apr, 2012 06:29 PM

    David Colebatch's Avatar

    I get it, and hopefully this work-around committed in the bundler gem
    codebase will fix our problems too:

    ...I suppose it's just a PITA that we were allowed to push gems with
    invalid .gemspec's in the first place!

    Thanks for your efforts!

  8. Support Staff 4 Posted by Eric Hodel on 16 Apr, 2012 11:20 PM

    Eric Hodel's Avatar

    If you're releasing a platform gem with JRuby then this is wrong:

    If you use Gem::Platform::CURRENT it will set the platform correctly for your packaged gem.

  9. Eric Hodel closed this discussion on 16 Apr, 2012 11:20 PM.

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

Keyboard shortcuts


? 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