[Rubygems-developers] [ rubygems-Patches-27409 ] Don't fail if I'm trying to install gem from gems cache (during local installation)

noreply at rubyforge.org noreply at rubyforge.org
Fri Nov 6 11:50:57 EST 2009


Patches item #27409, was opened at 2009-11-06 17:50
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=577&aid=27409&group_id=126

Category: `gem install`
Group: v1.3.x
Status: Open
Resolution: None
Priority: 3
Submitted By: Jakub Šťastný (botanicus)
Assigned to: Nobody (None)
Summary: Don't fail if I'm trying to install gem from gems cache (during local installation)

Initial Comment:
Hi guys,

I have my local gem repository (gems/shared, gems/development, gems/production etc), I store gems/*/cache in git and install from this cache). However every time I'm trying to install it, I got 

gem install ./net-ssh-gateway-1.0.1.gem -i ../../../gems/development --no-rdoc --no-ri --no-wrappers --no-test --no-update-sources --local -V --debug
ERROR:  While executing gem ... (ArgumentError)
    same file: /Users/random/Desktop/aspire/gems/development/cache/net-ssh-2.0.13.gem and /Users/random/Desktop/aspire/gems/development/cache/net-ssh-2.0.13.gem
	/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:1394:in `fu_each_src_dest'
	/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:1411:in `fu_each_src_dest0'
	/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:1393:in `fu_each_src_dest'
	/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:382:in `cp'
	/Library/Ruby/Site/1.8/rubygems/remote_fetcher.rb:145:in `download'
	/Library/Ruby/Site/1.8/rubygems/dependency_installer.rb:232:in `install'
	/Library/Ruby/Site/1.8/rubygems/dependency_installer.rb:222:in `each'
	/Library/Ruby/Site/1.8/rubygems/dependency_installer.rb:222:in `install'
	/Library/Ruby/Site/1.8/rubygems/commands/install_command.rb:118:in `execute'
	/Library/Ruby/Site/1.8/rubygems/commands/install_command.rb:115:in `each'
	/Library/Ruby/Site/1.8/rubygems/commands/install_command.rb:115:in `execute'
	/Library/Ruby/Site/1.8/rubygems/command.rb:257:in `invoke'
	/Library/Ruby/Site/1.8/rubygems/command_manager.rb:132:in `process_args'
	/Library/Ruby/Site/1.8/rubygems/command_manager.rb:102:in `run'
	/Library/Ruby/Site/1.8/rubygems/gem_runner.rb:58:in `run'
	/usr/bin/gem:21


The solution is pretty simple, just apply following patch for remote_fetcher.rb:

145c145,147
<           FileUtils.cp URI.unescape(source_uri.path), local_gem_path
---
>           unless File.expand_path(URI.unescape(source_uri.path)) == File.expand_path(local_gem_path)
>             FileUtils.cp URI.unescape(source_uri.path), local_gem_path
>           end

Please save my nerves and apply it soon, cheers!

----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=577&aid=27409&group_id=126


More information about the Rubygems-developers mailing list