[Rubygems-developers] gem update --system probably broken on OSX

Laurent Sansonetti laurent.sansonetti at gmail.com
Tue Nov 27 19:20:45 EST 2007


On Nov 28, 2007 12:38 AM, Mauricio Fernandez <mfp at acm.org> wrote:
> On Tue, Nov 27, 2007 at 11:11:08PM +0100, Laurent Sansonetti wrote:
> > On Nov 27, 2007 8:40 PM, Mauricio Fernandez <mfp at acm.org> wrote:
> > > I haven't experienced this directly, but the code is quite clear.
> > > I had to take a look at lib/rubygems.rb after receiving bug reports for
> > > FastRI+Leopard and found:
> > >
> > > Index: lib/rubygems.rb
> > > ===================================================================
> > > --- lib/rubygems.rb     (revision 1493)
> > > +++ lib/rubygems.rb     (revision 1498)
> > > [...]
> > > @@ -519,7 +522,7 @@
> > >      # not specified in the environment.
> > >      def default_dir
> > >        if defined? RUBY_FRAMEWORK_VERSION
> > > -        return File.join(File.dirname(Config::CONFIG["sitedir"]), "Gems")
> > > +        return File.join(File.dirname(Config::CONFIG["sitedir"]), "Gems", Config::CONFIG['ruby_version'])
> > >        else
> > >          File.join(Config::CONFIG['libdir'], 'ruby', 'gems', Config::CONFIG['ruby_version'])
> > >        end
> > >
> > > It seems that doing  gem update --system  will lose all your gems.
> > >
> >
> > Actually no, this code path wasn't used until Leopard provided a
> > version of Ruby distributed as a framework. The version of RubyGems
> > that ships by default in Leopard has this change too. Upgrading
> > RubyGems gem should not break anything in Leopard.
>
> (What happens if:
> * you are using Tiger & have a number of gems installed
> * you upgrade from Tiger to Leopard
> ?
>

If you installed a custom version of Ruby + RubyGems + some gems, they
should stay at the same place.

If you installed RubyGems with the system version of Ruby + some gems,
then I'm not sure, I think that the installer is not going to keep
them in the same place, because there would be some file system merge
errors. This is something I can investigate.

Anyway, the RUBY_FRAMEWORK_VERSION code path isn't executed in both use cases.

> It looks like the path changes both when RUBY_FRAMEWORK_VERSION was defined
> (because CONFIG["ruby_version"] is appended) and when it wasn't.)
>

RUBY_FRAMEWORK_VERSION is only defined in Leopard's Ruby. The code
path was there previously, but AFAIK nobody used it yet.

Adding the Ruby version to the path is crucial here, otherwise the
same path would be used for different versions of Ruby.

> As I said, I haven't experienced this myself. I got a bug report for FastRI
> caused by this path modification, and I was told that  gem update --system
> didn't work properly. There might be some other reason for that.
>

gem update --system didn't work until 0.9.5, because it retrieved a
version of RubyGems without the Leopard patch.  Many people
experienced it, this was probably the same issue.

I am pretty sure doing gem update --system now doesn't break Leopard's
configuration.

Laurent


More information about the Rubygems-developers mailing list