[Rubygems-developers] Trouble uninstalling gems

Charles Oliver Nutter headius at headius.com
Thu Apr 29 19:55:54 EDT 2010


On Thu, Apr 29, 2010 at 1:23 AM, James Britt <james at neurogami.com> wrote:
> Here's the problem:  if you do not pass a bindir value  then MRI "gem" will
> install bins in one place, and jruby 'gem" will use a different place.  This
> keeps different versions from stomping each other.
>
> But if you want to use a bindir option you're stuck having to use the same
> value for all versions of ruby that are parsing gemrc.

Yeah, this is a problem. Only one gemrc so only one set of options,
but multiple Rubies sharing that. It falls into the same category as
sharing gem homes: don't do it...but in this case, there's no other
option!

> Some possible fixes:
>
> Have the jruby version of rubygems look for
>
>  jruby_install:   ...
>  jruby_uninstall:  ...
>
> That is, have jruby-specific values.
>
> Another is to have the jruby rubygems munge that bndir value by appending
> '/jruby' to the end of whatever path is given.
>
> Or just have a jgemrc file.
>
> I prefer the more explicit approach, but don't like having  multiple gemrc
> files around if most of the values are going to be the same.
>
> So I thought perhaps the jruby rubygem could look for  a jgemrc file and use
> that to override any values in gemrc.
>
> Turns out that was easy to hack in.  I added some code that duplicates the
> current calls that loads /etc/.gemrc and ~/.gemrc, but looks for a .jgemrc
> file instead.  It then merges in the values after the standard config values
> are applied.
>
> Don't know if this is the nicest or best way to keep the different bindir
> locations distinct, but it seems to work.

I think this may simply be a gap in RubyGems. It already manages
repositories well, since even if you --user-install it puts things
under a "jruby" or a "ruby" dir depending on RUBY_ENGINE. So it seems
like it should do something similar for --bindir, allowing a
RUBY_ENGINE-specific config file (like a .gemrc-jruby vs .gemrc),
config lines (install-jruby: --bindir versus install: --bindir), or
target dir munging (<bindir>/jruby versus <bindir>).

I've copied the rubygems dev list on this reply...

RubyGem devs: Any thoughts on this? I think we've already decided that
sharing a gem root across impls is a bad idea, but since we share a
.gemrc we run into the same stomping problems.

- Charlie


More information about the Rubygems-developers mailing list