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

Mauricio Fernandez mfp at acm.org
Tue Nov 27 14:40:37 EST 2007

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'])
         File.join(Config::CONFIG['libdir'], 'ruby', 'gems', Config::CONFIG['ruby_version'])

It seems that doing  gem update --system  will lose all your gems.

PS: is such vendor/repackager-specific patching encouraged? In other words,
would it be acceptable to have FreeBSD, Debian, Gentoo and friends add a
number of  if defined? __SOME_PLATFORM_ID__ ...? If they were all allowed to
do what Apple did (provide patches to be applied by the RubyGems developers),
they would be able to solve problems like those discussed in ruby-talk
recently. Until a better alternative is provided, this would let those who
care about their RubyGems packaging help themselves, the way Apple did.

Mauricio Fernandez  -   http://eigenclass.org

More information about the Rubygems-developers mailing list