Hi,
Currently with trunk, gem unpack fails if you pass it a gem that isn't
in the default gems repository, but another repository.
It is the case in Mac OS X 10.5, where there are 2 repositories, but
all pre-installed gems being in the non-default one.
$ ruby -r rubygems -e "p Gem.dir, Gem.path"
"/Library/Ruby/Gems/1.8"
["/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8",
"/Library/Ruby/Gems/1.8"]
$ gem unpack termios
ERROR: While executing gem ... (Gem::Exception)
Cannot load gem at
[/Library/Ruby/Gems/1.8/cache/termios-0.9.4.gem] in /Volumes/Data
The following patch fixes the problem.
$ gem unpack termios
Unpacked gem: '/Volumes/Data/termios-0.9.4'
Laurent
Index: lib/rubygems/commands/unpack_command.rb
===================================================================
--- lib/rubygems/commands/unpack_command.rb (revision 1594)
+++ lib/rubygems/commands/unpack_command.rb (working copy)
@@ -73,7 +73,7 @@
# Furthermore, the name match must be exact (ignoring case).
if gemname =~ /^#{selected.name}$/i
filename = selected.full_name + '.gem'
- return File.join(Gem.dir, 'cache', filename)
+ return Gem.path.map { |d| File.join(d, 'cache', filename)
}.find { |p| File.exist?(p) }
else
return nil
end
_______________________________________________
Rubygems-developers mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rubygems-developers