Can't install any gems because of Errno::EEXIST errors

2,380 views
Skip to first unread message

schreibe...@googlemail.com

unread,
Mar 28, 2010, 8:57:43 AM3/28/10
to RubyInstaller
Hello all,

On my Windows 7 installation (fully updated), I can't install any
gems, with both 1.8.7 RC2 and 1.9.1 RC2 versions of rubyinstaller.

Both are installed at C:/Ruby and C:/Ruby19, respectively.

Here is the the debug output when installing e.g. rails:

C:\Users\schreiar.EMEA>gem install rails --debug
Exception `NameError' at C:/Ruby19/lib/ruby/site_ruby/1.9.1/rubygems/
command_man
ager.rb:161 - uninitialized constant Gem::Commands::InstallCommand
Exception `Errno::ENOENT' at C:/Ruby19/lib/ruby/1.9.1/fileutils.rb:245
- No such file or directory - C:/Users/schreiar.EMEA/.gem/ruby/1.9.1/
cache
Exception `Errno::EEXIST' at C:/Ruby19/lib/ruby/1.9.1/fileutils.rb:245
- File exists - C:
Exception `Errno::EEXIST' at C:/Ruby19/lib/ruby/1.9.1/fileutils.rb:221
- File exists - C:
Exception `Errno::ENOENT' at C:/Ruby19/lib/ruby/1.9.1/fileutils.rb:245
- No such file or directory - C:/Users/schreiar.EMEA/.gem/ruby/1.9.1/
doc
Exception `Errno::EEXIST' at C:/Ruby19/lib/ruby/1.9.1/fileutils.rb:245
- File exists - C:
Exception `Errno::EEXIST' at C:/Ruby19/lib/ruby/1.9.1/fileutils.rb:221
- File exists - C:
Exception `Errno::ENOENT' at C:/Ruby19/lib/ruby/1.9.1/fileutils.rb:245
- No such file or directory - C:/Users/schreiar.EMEA/.gem/ruby/1.9.1/
gems
Exception `Errno::EEXIST' at C:/Ruby19/lib/ruby/1.9.1/fileutils.rb:245
- File exists - C:
Exception `Errno::EEXIST' at C:/Ruby19/lib/ruby/1.9.1/fileutils.rb:221
- File exists - C:
Exception `Errno::ENOENT' at C:/Ruby19/lib/ruby/1.9.1/fileutils.rb:245
- No such
file or directory - C:/Users/schreiar.EMEA/.gem/ruby/1.9.1/
specifications
Exception `Errno::EEXIST' at C:/Ruby19/lib/ruby/1.9.1/fileutils.rb:245
- File exists - C:
Exception `Errno::EEXIST' at C:/Ruby19/lib/ruby/1.9.1/fileutils.rb:221
- File exists - C:
Exception `Gem::LoadError' at C:/Ruby19/lib/ruby/site_ruby/1.9.1/
rubygems.rb:827
- Could not find RubyGem test-unit (>= 0)

Exception `Gem::LoadError' at C:/Ruby19/lib/ruby/site_ruby/1.9.1/
rubygems.rb:827
- Could not find RubyGem sources (> 0.0.1)

Exception `Errno::ENOENT' at C:/Ruby19/lib/ruby/1.9.1/fileutils.rb:245
- No such file or directory - C:/Users/schreiar.EMEA/.gem/specs/
gems.rubyforge.org%80
Exception `Errno::EEXIST' at C:/Ruby19/lib/ruby/1.9.1/fileutils.rb:245
- File exists - C:
Exception `Errno::EEXIST' at C:/Ruby19/lib/ruby/1.9.1/fileutils.rb:221
- File exists - C:
Exception `Errno::ENOENT' at C:/Ruby19/lib/ruby/1.9.1/fileutils.rb:245
- No such file or directory - C:/Users/schreiar.EMEA/.gem/specs/
gems.rubyforge.org%80/quick/Marshal.4.8
Exception `Errno::EEXIST' at C:/Ruby19/lib/ruby/1.9.1/fileutils.rb:245
- File exists - C:
Exception `Errno::EEXIST' at C:/Ruby19/lib/ruby/1.9.1/fileutils.rb:221
- File exists - C:
ERROR: While executing gem ... (Errno::EEXIST)
File exists - C:
C:/Ruby19/lib/ruby/1.9.1/fileutils.rb:245:in `mkdir'
C:/Ruby19/lib/ruby/1.9.1/fileutils.rb:245:in `fu_mkdir'
C:/Ruby19/lib/ruby/1.9.1/fileutils.rb:217:in `block (2 levels)
in mkdir_p'
C:/Ruby19/lib/ruby/1.9.1/fileutils.rb:215:in `reverse_each'
C:/Ruby19/lib/ruby/1.9.1/fileutils.rb:215:in `block in
mkdir_p'
C:/Ruby19/lib/ruby/1.9.1/fileutils.rb:201:in `each'
C:/Ruby19/lib/ruby/1.9.1/fileutils.rb:201:in `mkdir_p'
C:/Ruby19/lib/ruby/site_ruby/1.9.1/rubygems/spec_fetcher.rb:
103:in `fetch_spec'
C:/Ruby19/lib/ruby/site_ruby/1.9.1/rubygems/spec_fetcher.rb:
72:in `block in fetch'
C:/Ruby19/lib/ruby/site_ruby/1.9.1/rubygems/spec_fetcher.rb:
71:in `map'
C:/Ruby19/lib/ruby/site_ruby/1.9.1/rubygems/spec_fetcher.rb:
71:in `fetch'
C:/Ruby19/lib/ruby/site_ruby/1.9.1/rubygems/
dependency_installer.rb:99:in `find_gems_with_sources'
C:/Ruby19/lib/ruby/site_ruby/1.9.1/rubygems/
dependency_installer.rb:192:in `find_spec_by_name_and_version'
C:/Ruby19/lib/ruby/site_ruby/1.9.1/rubygems/
dependency_installer.rb:213:in `install'
C:/Ruby19/lib/ruby/site_ruby/1.9.1/rubygems/commands/
install_command.rb:118:in `block in execute'
C:/Ruby19/lib/ruby/site_ruby/1.9.1/rubygems/commands/
install_command.rb:115:in `each'
C:/Ruby19/lib/ruby/site_ruby/1.9.1/rubygems/commands/
install_command.rb:115:in `execute'
C:/Ruby19/lib/ruby/site_ruby/1.9.1/rubygems/command.rb:257:in
`invoke'
C:/Ruby19/lib/ruby/site_ruby/1.9.1/rubygems/command_manager.rb:
132:in `process_args'
C:/Ruby19/lib/ruby/site_ruby/1.9.1/rubygems/command_manager.rb:
102:in `run'
C:/Ruby19/lib/ruby/site_ruby/1.9.1/rubygems/gem_runner.rb:
58:in `run'
C:/Ruby19/bin/gem:21:in `<main>'

C:\Users\schreiar.EMEA>

Apparently, the error comes from FileUtils#mkdir_p, specifically these
lines:

stack.reverse_each do |dir|
begin
fu_mkdir dir, options[:mode]
rescue SystemCallError => err
raise unless File.directory?(dir)
end
end

The Errno::EEXIST error gets raised by the fu_mkdir call and then gets
re-raised because File.directory("C:/") returns false, which it should
not, because obviously the directory exists.

Playing around in irb, I found this very weird behaviour:

irb(main):002:0> File.stat("C:")
=> #<File::Stat dev=0x2, ino=0, mode=040755, nlink=1, uid=0, gid=0,
rdev=0x2, si
ze=0, blksize=nil, blocks=nil, atime=2010-03-28 13:42:02 +0100,
mtime=2010-03-28
13:42:02 +0100, ctime=2009-12-17 13:09:59 +0100>
irb(main):003:0> File.stat("C:/")
Errno::EACCES: Permission denied - C:/
from (irb):3:in `stat'
from (irb):3
from C:/Ruby19/bin/irb:12:in `<main>'
irb(main):004:0> File.stat("C:\\")
Errno::EACCES: Permission denied - C:\
from (irb):4:in `stat'
from (irb):4
from C:/Ruby19/bin/irb:12:in `<main>'
irb(main):005:0> File.directory?("C:/")
=> false
irb(main):006:0> File.directory?("C:")
=> true

So the problem is, that I have no permission to access C:/, but I can
access C: perfectly fine. As FileUtils.mkdir_p uses C:/ and not C:,
things break.

Additionally, here is the icacls output for C:/ and C:

C:\Users\schreiar.EMEA>icacls C:\
C:\ BUILTIN\Administrators:(F)
BUILTIN\Administrators:(OI)(CI)(IO)(F)
NT AUTHORITY\SYSTEM:(F)
NT AUTHORITY\SYSTEM:(OI)(CI)(IO)(F)
BUILTIN\Users:(OI)(CI)(RX)
NT AUTHORITY\Authenticated Users:(OI)(CI)(IO)(M)
NT AUTHORITY\Authenticated Users:(AD)
Mandatory Label\High Mandatory Level:(OI)(NP)(IO)(NW)

Successfully processed 1 files; Failed processing 0 files

C:\Users\schreiar.EMEA>icacls C:
C: NT AUTHORITY\SYSTEM:(OI)(CI)(F)
BUILTIN\Administrators:(OI)(CI)(F)
EMEA\schreiar:(OI)(CI)(F)
Everyone:(RX)

Successfully processed 1 files; Failed processing 0 files

I'm pretty sure this has worked before, I suspect that some windows
update has borked my permissions. :(

Running gem install with administrator privileges works perfectly fine
and is kind of a workaround for me now.

Any idea what's wrong here?

Luis Lavena

unread,
Mar 30, 2010, 4:37:38 PM3/30/10
to rubyin...@googlegroups.com
On Sun, Mar 28, 2010 at 2:57 PM, schreibe...@googlemail.com
<schreibe...@googlemail.com> wrote:
> Hello all,
>
> On my Windows 7 installation (fully updated), I can't install any
> gems, with both 1.8.7 RC2 and 1.9.1 RC2 versions of rubyinstaller.
>
> Both are installed at C:/Ruby and C:/Ruby19, respectively.
>
> Here is the the debug output when installing e.g. rails:
>
> [...]

>
> I'm pretty sure this has worked before, I suspect that some windows
> update has borked my permissions. :(
>
> Running gem install with administrator privileges works perfectly fine
> and is kind of a workaround for me now.
>
> Any idea what's wrong here?
>

Questions:

- Did you upgrade from Windows Vista?
- Did you installed Ruby as Administrator or with administrators rights?

If you answer yes to upgrade from Windows Vista, there is a permission
issue over the NTFS that is a problem. Check the group for related
issue.

IF you answer yes to the second question, then is a permission issue
over the folder.

Please take in consideration that icacls will tell you the permissions
you have, but not that if you need elevation to actually use them.

Similar issue was raised in the group, please search for it and let us
know if that helped or not.

--
Luis Lavena
AREA 17
-
Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.
Antoine de Saint-Exupéry

Will Green

unread,
Mar 31, 2010, 12:45:42 AM3/31/10
to rubyinstaller
On Tue, Mar 30, 2010 at 4:37 PM, Luis Lavena <luisl...@gmail.com> wrote:
On Sun, Mar 28, 2010 at 2:57 PM, schreibe...@googlemail.com
<schreibe...@googlemail.com> wrote:
> Hello all,
>
> On my Windows 7 installation (fully updated), I can't install any
> gems, with both 1.8.7 RC2 and 1.9.1 RC2 versions of rubyinstaller.
>
> Both are installed at C:/Ruby and C:/Ruby19, respectively.
>
> Here is the the debug output when installing e.g. rails:
>
> [...]
>
> I'm pretty sure this has worked before, I suspect that some windows
> update has borked my permissions. :(
>
> Running gem install with administrator privileges works perfectly fine
> and is kind of a workaround for me now.
>
> Any idea what's wrong here?
>

I am seeing this issue now, too. It did not exist before (I was able to upgrade and install gems at will). I think some recent Windows Update to Windows 7 caused this.
 
Questions:

- Did you upgrade from Windows Vista?

Vista -> Win7 RC -> Win7 RTM. This problem only started recently, long after the Win7 RTM upgrade.
 
- Did you installed Ruby as Administrator or with administrators rights?

I've tried both the installer and the zip file. Did not run either as Administrator. Same issue with both packages.
 
If you answer yes to upgrade from Windows Vista, there is a permission
issue over the NTFS that is a problem. Check the group for related
issue.
 
I'll search around a bit.

Luis Lavena

unread,
Mar 31, 2010, 4:28:21 AM3/31/10
to rubyin...@googlegroups.com
On Wed, Mar 31, 2010 at 6:45 AM, Will Green <wi...@hotgazpacho.org> wrote:
> [...]

>
> I am seeing this issue now, too. It did not exist before (I was able to
> upgrade and install gems at will). I think some recent Windows Update to
> Windows 7 caused this.
>

I'm not seeing the issue or anything related to stat permission issues:

http://gist.github.com/350086

>>
>> Questions:
>>
>> - Did you upgrade from Windows Vista?
>
> Vista -> Win7 RC -> Win7 RTM. This problem only started recently, long after
> the Win7 RTM upgrade.
>

If you didn't format, it might be a leftover incorrect permission in the FS.

Like was here:

http://groups.google.com/group/rubyinstaller/browse_thread/thread/f79c24cbca7bb37b


>>
>> - Did you installed Ruby as Administrator or with administrators rights?
>
> I've tried both the installer and the zip file. Did not run either as
> Administrator. Same issue with both packages.
>

I've run Windows update, I've restart the machine with latest patches,
still no able to reproduce (Windwos 7 x64 Ultimate)

>>
>> If you answer yes to upgrade from Windows Vista, there is a permission
>> issue over the NTFS that is a problem. Check the group for related
>> issue.
>
>
> I'll search around a bit.

Since the problem seems stat, can you "File.stat" some of the Ruby
folders, and include your home and temporary directory?

Would like to know what "gem env" outputs and stat %USERPROFILE%/.gem
or whatever is set in your environment.

schreibe...@googlemail.com

unread,
Mar 31, 2010, 1:57:51 PM3/31/10
to RubyInstaller
> Questions:
>
> - Did you upgrade from Windows Vista?

No, I'm running a fresh installation of Windows 7 32-bit Enterprise
Edition.

> - Did you installed Ruby as Administrator or with administrators rights?

No, and I also tried both, installer and zip package.

> If you answer yes to upgrade from Windows Vista, there is a permission
> issue over the NTFS that is a problem. Check the group for related
> issue.
>
> IF you answer yes to the second question, then is a permission issue
> over the folder.
>
> Please take in consideration that icacls will tell you the permissions
> you have, but not that if you need elevation to actually use them.
>
> Similar issue was raised in the group, please search for it and let us
> know if that helped or not.

As I said, the same ruby installation was working perfectly fine some
weeks ago, and I can't remember having changed any permissions
manually.

Maybe this problem is only coming up in 32-bit versions of Windows 7,
as you seem to have no problems with your 64-bit installation.

Today I found out that this bug is apparently not ruby specific, but
is appearing in other applications as well! E.g. when I'm browsing for
a specific file in Eclipse (which I do not run with admin privileges),
I can't explore the C: root directory - but I can open any file when
directly specifying it's path!

File.stat works for all kinds of files and folders, both in the Ruby
installation and for different folders on my C: drive, only
File.stat('C:/') is failing with a permission denied folder.

--
Arthur Schreiber

Luis Lavena

unread,
Mar 31, 2010, 6:32:23 PM3/31/10
to rubyin...@googlegroups.com
On Wed, Mar 31, 2010 at 7:57 PM, schreibe...@googlemail.com
<schreibe...@googlemail.com> wrote:
>
> Maybe this problem is only coming up in 32-bit versions of Windows 7,
> as you seem to have no problems with your 64-bit installation.
>

Going to install a clean copy of Windows 7 32bits in a VM and keep you posted.

Apologizes I cannot provide you a workaround to this situation

Will Green

unread,
Mar 31, 2010, 11:33:01 PM3/31/10
to rubyin...@googlegroups.com
On Wed, Mar 31, 2010 at 4:28 AM, Luis Lavena <luisl...@gmail.com> wrote:

I'm not seeing the issue or anything related to stat permission issues:

http://gist.github.com/350086

I am:

C:\Users\Will>ruby -v
ruby 1.8.7 (2010-01-10 patchlevel 249) [i386-mingw32]

C:\Users\Will>ruby -e "puts File.directory?('C:/')"
false
 
If you didn't format, it might be a leftover incorrect permission in the FS.

Like was here:

http://groups.google.com/group/rubyinstaller/browse_thread/thread/f79c24cbca7bb37b

I saw that thread, my icacls:

C:\Users\Will>icacls C:\Ruby
C:\Ruby BUILTIN\Administrators:(I)(F)
        BUILTIN\Administrators:(I)(OI)(CI)(IO)(F)
        NT AUTHORITY\SYSTEM:(I)(F)
        NT AUTHORITY\SYSTEM:(I)(OI)(CI)(IO)(F)
        BUILTIN\Users:(I)(OI)(CI)(RX)
        NT AUTHORITY\Authenticated Users:(I)(M)
        NT AUTHORITY\Authenticated Users:(I)(OI)(CI)(IO)(M)

Successfully processed 1 files; Failed processing 0 files

C:\Users\Will>icacls C:\
C:\ BUILTIN\Administrators:(F)
    BUILTIN\Administrators:(OI)(CI)(IO)(F)
    NT AUTHORITY\SYSTEM:(F)
    NT AUTHORITY\SYSTEM:(OI)(CI)(IO)(F)
    BUILTIN\Users:(OI)(CI)(RX)
    NT AUTHORITY\Authenticated Users:(OI)(CI)(IO)(M)
    NT AUTHORITY\Authenticated Users:(AD)
    Mandatory Label\High Mandatory Level:(OI)(NP)(IO)(NW)

Successfully processed 1 files; Failed processing 0 files
 
Since the problem seems stat, can you "File.stat" some of the Ruby

folders, and include your home and temporary directory?

C:\Users\Will>ruby -e "puts File.directory?('C:/Users/Will')"
true

C:\Users\Will>set TEMP
TEMP=C:\Users\Will\AppData\Local\Temp

C:\Users\Will>ruby -e "puts File.directory?('C:/Users/Will/AppData/Local/Temp')"
true
 
Would like to know what "gem env" outputs and stat %USERPROFILE%/.gem
or whatever is set in your environment.


C:\Users\Will>gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 1.3.5
  - RUBY VERSION: 1.8.7 (2010-01-10 patchlevel 249) [i386-mingw32]
  - INSTALLATION DIRECTORY: C:/Ruby/lib/ruby/gems/1.8
  - RUBY EXECUTABLE: C:/Ruby/bin/ruby.exe
  - EXECUTABLE DIRECTORY: C:/Ruby/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-mingw32
  - GEM PATHS:
     - C:/Ruby/lib/ruby/gems/1.8
     - C:/Users/Will/.gem/ruby/1.8
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:

C:\Users\Will>ruby -e "puts File.directory?('C:/Users/Will/.gem')"
true
 
BTW, this is all on Windows 7 Ultimate 32 bit, with UAC set to the default level. My user is a member of Administrators. If I start the Command Prompt as an Administrator, I can install gems, no problem.

Octagon

unread,
Apr 2, 2010, 3:23:50 AM4/2/10
to RubyInstaller
It is always a good idea to check if something related to the problem
is written to the virtual storage, normally at c:\Users\<you>\AppData
\Local\VirtualStore.

Luis Lavena

unread,
Apr 3, 2010, 8:57:38 AM4/3/10
to rubyin...@googlegroups.com
On Thu, Apr 1, 2010 at 12:32 AM, Luis Lavena <luisl...@gmail.com> wrote:
> On Wed, Mar 31, 2010 at 7:57 PM, schreibe...@googlemail.com
> <schreibe...@googlemail.com> wrote:
>>
>> Maybe this problem is only coming up in 32-bit versions of Windows 7,
>> as you seem to have no problems with your 64-bit installation.
>>
>
> Going to install a clean copy of Windows 7 32bits in a VM and keep you posted.
>

Ok, I've:

* Installed Windows 7 Ultimate 32bits inside VirtualBox
* Downloaded latest security updates and restarted
* Installed RubyInstaller 1.8.7 RC2 into C:\Ruby187, no PATH modification
* I've installed with success rake:

http://pastie.org/901603

Doing "gem install rails --debug" right now, and all the RDoc output
is making me dizzy.

Is there something that you recently installed? changed? Driver,
antivirus, anything?

Will Green

unread,
Apr 4, 2010, 4:22:25 PM4/4/10
to rubyin...@googlegroups.com
I can't think of any recent installs, other than iTunes 9.1, but that was after the troubles started happening.

What setting do you have for User Account Control? I'm running at the default level, and  I can gem install just fine if I run the console as Administrator, so it is most definitely a permissions issue. I just wish I knew what changed in the last month.

I swear, I'm about to disable UAC just to get back to a point where things work as I would expect.

--
--
You received this message because you are subscribed to the Google Groups "RubyInstaller" group.
To post to this group, send email to rubyin...@googlegroups.com.
To unsubscribe from this group, send email to rubyinstalle...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyinstaller?hl=en.


Luis Lavena

unread,
Apr 4, 2010, 4:32:03 PM4/4/10
to rubyin...@googlegroups.com
On Sun, Apr 4, 2010 at 10:22 PM, Will Green <wi...@hotgazpacho.org> wrote:
> I can't think of any recent installs, other than iTunes 9.1, but that was
> after the troubles started happening.
>
> What setting do you have for User Account Control? I'm running at the
> default level, and  I can gem install just fine if I run the console as
> Administrator, so it is most definitely a permissions issue. I just wish I
> knew what changed in the last month.

That could mean that Ruby or Ruby folder installation was done under
Administrative rights.

Can you install, with the current UAC level you have and not elevation
into a new folder?

> I swear, I'm about to disable UAC just to get back to a point where things
> work as I would expect.
>

Please don't. My test was done without touching any UAC setting,
meaning was the default one. It worked.

That means something else is in the middle that is not related to UAC
or RubyInstaller.

On my Windows x64 I have UAC in High, meaning it prompts me every time
I do a change on system settings or ProgramFiles / Windows folders.

Meaning: quite rarely, since I don't mess with that (except for
program installation)

Please try a new installation into an non existing folder and try
installing gems in it.

File.stat or File.directory? is not he issue, it might be another
permission thing that is in the middle.

Thank you.

Will Green

unread,
Apr 4, 2010, 9:14:29 PM4/4/10
to rubyinstaller
That could mean that Ruby or Ruby folder installation was done under
Administrative rights.

I have never run the installer as Adminisitrator.
 
Can you install, with the current UAC level you have and not elevation
into a new folder?

Sure. I just did a new install into C:\Ruby187. This directory has never existed.
 
Please try a new installation into an non existing folder and try
installing gems in it.

File.stat or File.directory? is not he issue, it might be another
permission thing that is in the middle.

C:\Users\Will>ruby -v
ruby 1.8.7 (2010-01-10 patchlevel 249) [i386-mingw32]

C:\Users\Will>which ruby
C:\Ruby187\bin\ruby.EXE

C:\Users\Will>ruby -e "puts File.directory? 'C:/'
false

C:\Users\Will>ruby -e "puts File.stat 'C:/'
-e:1:in `stat': Permission denied - C:/ (Errno::EACCES)
        from -e:1

C:\Users\Will>gem install rails
ERROR:  While executing gem ... (Errno::EEXIST)
    File exists - C:

Will Green

unread,
Apr 4, 2010, 9:20:56 PM4/4/10
to rubyinstaller
I wonder if it is related to this: http://support.microsoft.com/kb/970789

"A folder that is created under the root of the system drive is missing entries in its security descriptor, which may cause some application failures on the English version of Windows 7 Release Candidate 32-bit Ultimate"

I /did/ have Win7 RC installed on this machine. Going to see if I can get a hold of CleanWin7RCRoot.exe and see if that fixes the issue. Would hate to have to repave this machine...

Luis Lavena

unread,
Apr 5, 2010, 4:14:07 AM4/5/10
to rubyin...@googlegroups.com
On Mon, Apr 5, 2010 at 3:20 AM, Will Green <wi...@hotgazpacho.org> wrote:
> I wonder if it is related to this: http://support.microsoft.com/kb/970789
>
> "A folder that is created under the root of the system drive is missing
> entries in its security descriptor, which may cause some application
> failures on the English version of Windows 7 Release Candidate 32-bit
> Ultimate"
>

Interesting.

In my latest 32bits testing I tried a clean RTM version of Windows 7,
and before i had a RC of 64bits, never 32bits.

> I /did/ have Win7 RC installed on this machine. Going to see if I can get a
> hold of CleanWin7RCRoot.exe and see if that fixes the issue. Would hate to
> have to repave this machine...

Since you updated from Beta to RC and then RTM, that means that the
permission issue might come along with you.

Well, please take a look to the workaround, that will fix the C:\ and
from there, you can go to Ruby187 folder and make it reuse the
inherited permissions.

Try the manual path as the tool will not install if is not RC version.

Please keep us posted.

Johannes Brodwall

unread,
Apr 5, 2010, 6:12:48 AM4/5/10
to RubyInstaller
I had the same problem. I installed Ruby 1.9.1 by unpacking the files
as a normal user (not administrator).

A simple workaround is to start a cmd.exe window with Run as
administrator and run the gem commands from that window. (Just like
Mac and Linux users do "sudo gem").


~Johannes

On Mar 28, 2:57 pm, "schreiber.art...@googlemail.com"

Luis Lavena

unread,
Apr 5, 2010, 6:16:56 AM4/5/10
to rubyin...@googlegroups.com
On Mon, Apr 5, 2010 at 12:12 PM, Johannes Brodwall <jha...@gmail.com> wrote:
> I had the same problem. I installed Ruby 1.9.1 by unpacking the files
> as a normal user (not administrator).
>
> A simple workaround is to start a cmd.exe window with Run as
> administrator and run the gem commands from that window. (Just like
> Mac and Linux users do "sudo gem").
>

Thank you Johannes for your answer.

However, that is far from ideal.

If you installed Ruby without Admin permissions, you should be able to
install gems without them too.

Please see the other responses on this and specially Will Green findings:

http://groups.google.com/group/rubyinstaller/msg/f9cbd4312d49cdf3

Will Green

unread,
Apr 5, 2010, 7:06:50 AM4/5/10
to rubyinstaller
Since you updated from Beta to RC and then RTM, that means that the
permission issue might come along with you.

Well, please take a look to the workaround, that will fix the C:\ and
from there, you can go to Ruby187 folder and make it reuse the
inherited permissions.

Try the manual path as the tool will not install if is not RC version.

I tried the manual path last night:

Cd \ 
cacls \ /S:D:PAI(A;;FA;;;BA)(A;OICIIO;GA;;;BA)(A;;FA;;;SY)(A;OICIIO;GA;;;SY)(A;OICI;0x1200a9;;;BU)(A;OICIIO;SDGXGWGR;;;AU)(A;;LC;;;AU) 
icacls \ /setintegritylevel (OI)(NP)(IO)H

I also did this, as the KB article suggested:

Cd \ 
Cd Ruby187 
cacls C:\Ruby187 /S:D:AI 

That didn't work, either.

I wonder if one of the SysInternals tools could help. That, or its time to pave this machine.

--
Will Green
 

Luis Lavena

unread,
Apr 5, 2010, 10:04:34 AM4/5/10
to rubyin...@googlegroups.com

Can you try something one last time?

Applied the cacls trick, remove completely Ruby187 (uninstall and
delete folder) and install it again.

Then, try gem installation.

If doesn't work, I've completely exhausted my knowledge and tools to
avoid you reinstallation.

Sorry.

Octagon

unread,
Apr 5, 2010, 1:39:13 PM4/5/10
to RubyInstaller
You know, there must be something since this is what I got on XP:

t:\Media\Samurai7>gem list

*** LOCAL GEMS ***

actionmailer (2.3.5)
actionpack (2.3.5)
activerecord (2.3.5)
activeresource (2.3.5)
activesupport (2.3.5)
rack (1.0.1)
rails (2.3.5)
rake (0.8.7)

t:\Media\Samurai7>gem uninstall rake
Remove executables:
rake

in addition to the gem? [Yn]
Removing rake

You have requested to uninstall the gem:
rake-0.8.7
rails-2.3.5 depends on [rake (>= 0.8.3)]
If you remove this gems, one or more dependencies will not be met.
Continue with Uninstall? [Yn]
Successfully uninstalled rake-0.8.7

t:\Media\Samurai7>gem install rake --debug
Exception `NameError' at Q:/ruby/lib/ruby/site_ruby/1.9.1/rubygems/
command_manager.rb:161 - uninitialized constant Gem::
Commands::InstallCommand
Exception `Gem::LoadError' at Q:/ruby/lib/ruby/site_ruby/1.9.1/


rubygems.rb:827 - Could not find RubyGem test-unit (>= 0)


Exception `Gem::LoadError' at Q:/ruby/lib/ruby/site_ruby/1.9.1/


rubygems.rb:827 - Could not find RubyGem sources (> 0.0.1
)

Exception `NoMethodError' at Q:/ruby/lib/ruby/site_ruby/1.9.1/rubygems/
package/tar_input.rb:48 - undefined method `readp
artial' for #<Gem::Package::TarReader::Entry:0x1b92a20>
Exception `IOError' at Q:/ruby/lib/ruby/site_ruby/1.9.1/rubygems/
format.rb:50 - closed stream
Exception `Errno::EEXIST' at Q:/ruby/lib/ruby/1.9.1/fileutils.rb:243 -
File exists - Q:/ruby/lib/ruby/gems/1.9.1
Exception `Errno::EEXIST' at Q:/ruby/lib/ruby/1.9.1/fileutils.rb:243 -
File exists - Q:/ruby/lib/ruby/gems/1.9.1/gems/ra
ke-0.8.7
Exception `Errno::EEXIST' at Q:/ruby/lib/ruby/1.9.1/fileutils.rb:243 -
File exists - Q:/ruby/lib/ruby/gems/1.9.1/gems/ra
ke-0.8.7
Exception `Errno::EEXIST' at Q:/ruby/lib/ruby/1.9.1/fileutils.rb:243 -
File exists - Q:/ruby/lib/ruby/gems/1.9.1/gems/ra
ke-0.8.7
Exception `Errno::EEXIST' at Q:/ruby/lib/ruby/1.9.1/fileutils.rb:243 -
File exists - Q:/ruby/lib/ruby/gems/1.9.1/gems/ra
ke-0.8.7
Exception `Errno::EEXIST' at Q:/ruby/lib/ruby/1.9.1/fileutils.rb:243 -
File exists - Q:/ruby/lib/ruby/gems/1.9.1/gems/ra
ke-0.8.7
Exception `Errno::EEXIST' at Q:/ruby/lib/ruby/1.9.1/fileutils.rb:243 -
File exists - Q:/ruby/lib/ruby/gems/1.9.1/gems/ra
ke-0.8.7
Exception `Errno::ENOENT' at Q:/ruby/lib/ruby/1.9.1/fileutils.rb:243 -
No such file or directory - Q:/ruby/lib/ruby/gems
/1.9.1/gems/rake-0.8.7/lib/rake
Exception `Errno::EACCES' at Q:/ruby/lib/ruby/1.9.1/fileutils.rb:243 -
Permission denied - Q:
Exception `Errno::EEXIST' at Q:/ruby/lib/ruby/1.9.1/fileutils.rb:243 -
File exists - Q:/ruby
Exception `Errno::EEXIST' at Q:/ruby/lib/ruby/1.9.1/fileutils.rb:243 -
File exists - Q:/ruby/lib
Exception `Errno::EEXIST' at Q:/ruby/lib/ruby/1.9.1/fileutils.rb:243 -
File exists - Q:/ruby/lib/ruby
Exception `Errno::EEXIST' at Q:/ruby/lib/ruby/1.9.1/fileutils.rb:243 -
File exists - Q:/ruby/lib/ruby/gems

And so on ...............................

Exception `Errno::EEXIST' at Q:/ruby/lib/ruby/1.9.1/fileutils.rb:243 -
File exists - classes/Test
Exception `Errno::EEXIST' at Q:/ruby/lib/ruby/1.9.1/fileutils.rb:243 -
File exists - classes/Test/Unit
Exception `Errno::EEXIST' at Q:/ruby/lib/ruby/1.9.1/fileutils.rb:243 -
File exists - classes/Test/Unit/Collector
Exception `Errno::EEXIST' at Q:/ruby/lib/ruby/1.9.1/fileutils.rb:243 -
File exists - classes
Exception `Errno::EEXIST' at Q:/ruby/lib/ruby/1.9.1/fileutils.rb:243 -
File exists - classes

t:\Media\Samurai7>gem list

*** LOCAL GEMS ***

actionmailer (2.3.5)
actionpack (2.3.5)
activerecord (2.3.5)
activeresource (2.3.5)
activesupport (2.3.5)
rack (1.0.1)
rails (2.3.5)
rake (0.8.7)

t:\Media\Samurai7>

So, there are lots of EEXIST errors, but the gem is installed OK. My
best guess is that it is a --debug issue.

Luis Lavena

unread,
Apr 5, 2010, 2:22:13 PM4/5/10
to rubyin...@googlegroups.com

It is normal see a lot of Errno:EEXIST raised by fileutils

> So, there are lots of EEXIST errors, but the gem is installed OK. My
> best guess is that it is a --debug issue.

RubyGems is catching them and showing in the output, but is safe to
assume is not a problem.

The problem is in the cases where RubyGem IS NOT catching the
exception, and that is when things fail, like happen to you and Will.

It is beyond my expertise deal with NTFS ACLs. Please accept my
apologies for the issues you're experiencing.

Will Green

unread,
Apr 8, 2010, 12:33:48 AM4/8/10
to rubyinstaller
On Mon, Apr 5, 2010 at 10:04 AM, Luis Lavena <luisl...@gmail.com> wrote:
Can you try something one last time?

Applied the cacls trick, remove completely Ruby187 (uninstall and
delete folder) and install it again.

Then, try gem installation.

Same problem :-(
 
If doesn't work, I've completely exhausted my knowledge and tools to
avoid you reinstallation.

Sorry.

No worries. Thanks for your help. Probably need to re-install.
 
--
Luis Lavena
AREA 17
-
Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.
Antoine de Saint-Exupéry

schreibe...@googlemail.com

unread,
Apr 8, 2010, 2:39:41 AM4/8/10
to RubyInstaller
The Problem lies not in that Rubygems does not catch an Errno::EEXIST
error, but in the fact that the Ruby process does not have any
permissions to access the C:/ root folder. Accessing any other folder
on the system with Ruby works perfectly fine.

Rubygems catches the Errno::EEXIST error, then tests whether the C:/
directory exists, which returns false (because of the missing
permissions) and causes Rubygems to re-raise the Errno::EEXIST error,
causing the gem install command to fail.

This is _not_ a ruby specific issue, (at least on my machine) I see
this issue with other software applications too (e.g. Eclipse and Git
expose all kinds of weird permission problems, but e texteditor does
not), when they try to access the C:/ root folder directly!

I'm running a clean Win7 32-bit install, so it's not an upgrade issue,
either.

Other software I have installed is Cygwin, not sure whether that has
broken my permissions.

Luis Lavena

unread,
Apr 8, 2010, 6:52:36 AM4/8/10
to rubyin...@googlegroups.com
On Thu, Apr 8, 2010 at 3:39 AM, schreibe...@googlemail.com
<schreibe...@googlemail.com> wrote:
> [...]

>
> This is _not_ a ruby specific issue, (at least on my machine) I see
> this issue with other software applications too (e.g. Eclipse and Git
> expose all kinds of weird permission problems, but e texteditor does
> not), when they try to access the C:/ root folder directly!
>
> I'm running a clean Win7 32-bit install, so it's not an upgrade issue,
> either.
>

Did you formatted your harddrive? I mean, is a real clean install?

> Other software I have installed is Cygwin, not sure whether that has
> broken my permissions.
>

I don't think so, but since I cannot replicate is even more harder to
find the root of the problem.

Javier Martinez Fernandez

unread,
Apr 15, 2010, 1:51:43 PM4/15/10
to RubyInstaller
Same problem here (in two machines with win 7 64b and 7 32b).
In both computers, cygwin installed.
I can assure that, but it seems that the problem appeared after the
installation of cygwin.

On 8 abr, 12:52, Luis Lavena <luislav...@gmail.com> wrote:
> On Thu, Apr 8, 2010 at 3:39 AM, schreiber.art...@googlemail.com

Luis Lavena

unread,
Apr 15, 2010, 2:30:15 PM4/15/10
to rubyin...@googlegroups.com
On Thu, Apr 15, 2010 at 2:51 PM, Javier Martinez Fernandez
<ecent...@gmail.com> wrote:
> Same problem here (in two machines with win 7 64b and 7 32b).
> In both computers, cygwin installed.
> I can assure that, but it seems that the problem appeared after the
> installation of cygwin.
>

Can you remove all the dot files form your HOME (%USERPROFILE%) folder?

Also, do gem installation outside cygwin bash prompt, never inside.

Please let us know

Javier Martínez Fernández

unread,
Apr 16, 2010, 3:13:08 AM4/16/10
to rubyin...@googlegroups.com
Removing all dot files (including folders) and using a cmd window...
same problem!

Any more ideas?

2010/4/15 Luis Lavena <luisl...@gmail.com>:

Luis Lavena

unread,
Apr 16, 2010, 7:43:51 AM4/16/10
to rubyin...@googlegroups.com
2010/4/16 Javier Martínez Fernández <ecent...@gmail.com>:
> Removing all dot files (including folders) and using a cmd window...
> same problem!
>
> Any more ideas?
>

How did you installed RubyInstaller? as administrator?

Can you try installing without elevation of user into a different
folder? Previously on this thread there is a link to a Microsoft KB
article that might contain a fix, can you check that?

Bosko Ivanisevic

unread,
Apr 16, 2010, 9:02:07 AM4/16/10
to rubyin...@googlegroups.com
On Fri, Apr 16, 2010 at 1:43 PM, Luis Lavena <luisl...@gmail.com> wrote:
2010/4/16 Javier Martínez Fernández <ecent...@gmail.com>:
> Removing all dot files (including folders) and using a cmd window...
> same problem!
>
> Any more ideas?
>

How did you installed RubyInstaller? as administrator?

Can you try installing without elevation of user into a different
folder? Previously on this thread there is a link to a Microsoft KB
article that might contain a fix, can you check that?


Besides this check that cygwin is not in the path. 

--
Regards,
Bosko Ivanisevic

Javier Martinez Fernandez

unread,
Apr 16, 2010, 10:07:36 AM4/16/10
to RubyInstaller
Ruby was installed with a normal account.
Cygwin is not in the system path.
The microsoft fix is for english rc windows version. I'm now in a
final windows ultimate 32b version.

If it helps, I installed "rubyinstaller-1.9.1-p378-rc2.exe"

Thanks.

On 16 abr, 15:02, Bosko Ivanisevic <bosko.ivanise...@gmail.com> wrote:
> On Fri, Apr 16, 2010 at 1:43 PM, Luis Lavena <luislav...@gmail.com> wrote:
> > 2010/4/16 Javier Martínez Fernández <ecentin...@gmail.com>:

Luis Lavena

unread,
Apr 16, 2010, 5:31:56 PM4/16/10
to rubyin...@googlegroups.com
On Fri, Apr 16, 2010 at 11:07 AM, Javier Martinez Fernandez
<ecent...@gmail.com> wrote:
> Ruby was installed with a normal account.
> Cygwin is not in the system path.
> The microsoft fix is for english rc windows version. I'm now in a
> final windows ultimate 32b version.
>
> If it helps, I installed "rubyinstaller-1.9.1-p378-rc2.exe"
>

Please scroll down to the manual instruction details.

It is weird that all the reports are coming from 7 ultimate in 32 bits mode.

Might I ask if those are legal copies? I've tried to replicate on a
clean installation, using ultimate 32bits and couldn't reproduce.

It might be something interfering.

Can you please provide us the following in a pastie/gist:

SET PATH
SET GEM
gem env

Thank you.

--
Luis Lavena
AREA 17
-
Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.
Antoine de Saint-Exupéry

Will Green

unread,
Apr 16, 2010, 11:30:46 PM4/16/10
to rubyinstaller
On Fri, Apr 16, 2010 at 5:31 PM, Luis Lavena <luisl...@gmail.com> wrote:
On Fri, Apr 16, 2010 at 11:07 AM, Javier Martinez Fernandez
<ecent...@gmail.com> wrote:
> Ruby was installed with a normal account.
> Cygwin is not in the system path.
> The microsoft fix is for english rc windows version. I'm now in a
> final windows ultimate 32b version.
>
> If it helps, I installed "rubyinstaller-1.9.1-p378-rc2.exe"
>

Please scroll down to the manual instruction details.

It is weird that all the reports are coming from 7 ultimate in 32 bits mode.

Might I ask if those are legal copies?

If the ISO and license keys from my MSDN account are legal, then yes. ;-)
 
I've tried to replicate on a
clean installation, using ultimate 32bits and couldn't reproduce.

It might be something interfering.

FWIW, I do not encounter the issue on either of the machines at work. Both of those were Vista SP2 -> Windows 7 32 bits. So, the major difference was the intermediate step of Windows 7 RC on my home box. I'm betting that has something to do with it.

I finally broke down and turned off UAC. I have no problem installing gems now. This will suffice until I get fed up enough to adopt a scorched-earth approach and re-image this machine.
 

Can you please provide us the following in a pastie/gist:

SET PATH
SET GEM
gem env

Thank you.

--
Luis Lavena
AREA 17
-
Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.
Antoine de Saint-Exupéry

--
You received this message because you are subscribed to the Google Groups "RubyInstaller" group.
To post to this group, send email to rubyin...@googlegroups.com.
To unsubscribe from this group, send email to rubyinstalle...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyinstaller?hl=en.

Luis Lavena

unread,
Apr 16, 2010, 11:38:41 PM4/16/10
to rubyin...@googlegroups.com
On Sat, Apr 17, 2010 at 12:30 AM, Will Green <wi...@hotgazpacho.org> wrote:
> On Fri, Apr 16, 2010 at 5:31 PM, Luis Lavena <luisl...@gmail.com> wrote:
>>
>> Might I ask if those are legal copies?
>
> If the ISO and license keys from my MSDN account are legal, then yes. ;-)
>

Sorry, needed to ask, since is really odd

>>
>> I've tried to replicate on a
>> clean installation, using ultimate 32bits and couldn't reproduce.
>>
>> It might be something interfering.
>
> FWIW, I do not encounter the issue on either of the machines at work. Both
> of those were Vista SP2 -> Windows 7 32 bits. So, the major difference was
> the intermediate step of Windows 7 RC on my home box. I'm betting that has
> something to do with it.


Well, if the cacls from RC hasn't been changed as the KB indicates (or
it doesn't work that way) then the issue will be the RC -> RTM route,
not Vista -> 7

I could say that: unless the cacls is modified or a fresh NTFS (aka:
formatted) is used, the issue will persist

> I finally broke down and turned off UAC. I have no problem installing gems
> now. This will suffice until I get fed up enough to adopt a
> scorched-earth approach and re-image this machine.
>

While it solve the problem, I just give me the chill thing that you're
surfing the web, on Windows, without protection :P

Adding this issue to the Wiki for future questions.

Luis Lavena

unread,
Jun 16, 2010, 7:18:28 AM6/16/10
to rubyin...@googlegroups.com
On Wed, Jun 16, 2010 at 4:32 AM, Solidify <max.ho...@gmail.com> wrote:
>
>> Can you remove all the dot files form your HOME (%USERPROFILE%) folder?
>>
>> Also, do gem installation outside cygwin bash prompt, never inside.
>>
>
> Absolutely strange. Same problem. Win7-32bit, non-RC-update. Adding a
> new non-admin user solves the problem, but WHY?
>
> Dotted files deleted. Cygwin, Msysgit uninstalled.
> Path: %SystemRoot%\system32;%SystemRoot%;C:\Ruby187\bin
>
> C:\Users\Max>gem install tzinfo

> ERROR:  While executing gem ... (Errno::EEXIST)
>    File exists - C:
>

File Exist error? are you running an editor that is locking the Ruby folder?

We hard of a problem with NTFS before:

http://wiki.github.com/oneclick/rubyinstaller/troubleshooting#gems_win7

It might be that your NTFS is coming from a Windows Vista
installation? the permissions might be wrong.

Also, if you installed Ruby as administrator, then a normal command
prompt do not have permission to write over the existing files.

Solidify

unread,
Jun 16, 2010, 8:12:51 PM6/16/10
to RubyInstaller
Hi Luis, thanks for your marvelous support!

> File Exist error? are you running an editor that is locking the Ruby folder?
no.
checked that. Also checked permissions with the tools described by
microsoft (icacls).

> It might be that your NTFS is coming from a Windows Vista
> installation? the permissions might be wrong.
no.

> Also, if you installed Ruby as administrator, then a normal command
> prompt do not have permission to write over the existing files.
>
I didn't install it as admin.

I found out another strange thing. I can install the i18n and rake
gems, but cannot install the others (f.ex. tzinfo or bundler). From
normal user command prompt, no admin involved. It looks like I will
have to do a clean reinstall of 7, don't want to bother you with that
if most people don't face these problems...
Thanks anyway!
Max

Sonja Elen Kisa

unread,
Jun 17, 2010, 8:05:46 PM6/17/10
to RubyInstaller
So the solution is to disable UAC?

I'm having this issue too.

Luis Lavena

unread,
Jun 17, 2010, 8:56:12 PM6/17/10