Project

General

Profile

Actions

Bug #3056

closed

gem unpack fails

Added by nobu (Nobuyoshi Nakada) over 14 years ago. Updated over 13 years ago.

Status:
Closed
Target version:
ruby -v:
ruby 1.9.2dev (2010-04-21 trunk 27424) [i686-linux]
Backport:
[ruby-core:29158]

Description

=begin
Hi

`gem unpack something.gem' fails by following error.

ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions into the /opt/local/lib/ruby/gems/1.9.1 directory.

I consider it regression.

This is a workaround, but I suspect why unpack method is
defined in Installer class.


diff --git i/lib/rubygems/installer.rb w/lib/rubygems/installer.rb
index 50f8d20..9be87fa 100644
--- i/lib/rubygems/installer.rb
+++ w/lib/rubygems/installer.rb
@@ -132,9 +132,6 @@ class Gem::Installer
end
end

  • FileUtils.mkdir_p @gem_home

  • raise Gem::FilePermissionError, @gem_home unless File.writable? @gem_home

  • @spec = @format.spec

    @gem_dir = File.join(@gem_home, "gems", @spec.full_name).untaint
    @@ -187,6 +184,7 @@ class Gem::Installer
    end

    FileUtils.mkdir_p @gem_home unless File.directory? @gem_home

  • raise Gem::FilePermissionError, @gem_home unless File.writable? @gem_home

    Gem.ensure_gem_subdirectories @gem_home

diff --git i/test/rubygems/test_gem_install_update_options.rb w/test/rubygems/test_gem_install_update_options.rb
index 385fd9d..6735f0b 100644
--- i/test/rubygems/test_gem_install_update_options.rb
+++ w/test/rubygems/test_gem_install_update_options.rb
@@ -56,8 +56,9 @@ class TestGemInstallUpdateOptions < GemInstallerTestCase
File.chmod 0755, @userhome
FileUtils.chmod 0000, @gemhome

  •  @installer = Gem::Installer.new @gem, @cmd.options
     assert_raises(Gem::FilePermissionError) do
    
  •    @installer = Gem::Installer.new @gem, @cmd.options
    
  •    @installer.install
     end
    
    end
    ensure

--
Nobu Nakada
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0