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

2,343 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
to rubyin...@googlegroups.com
On Thu, Jun 17, 2010 at 8:05 PM, Sonja Elen Kisa <son...@gmail.com> wrote:
> So the solution is to disable UAC?
>
> I'm having this issue too.
>

Did you upgrade from RC or Vista?

Did you try to install to a different folder and without administrative rights?

Charles Roper

unread,
Jul 9, 2010, 1:04:38 PM7/9/10
to RubyInstaller
On Jun 18, 1:56 am, Luis Lavena <luislav...@gmail.com> wrote:
> On Thu, Jun 17, 2010 at 8:05 PM, Sonja Elen Kisa <sonj...@gmail.com> wrote:
>
> > So the solution is to disable UAC?
>
> > I'm having this issue too.
>
> Did you upgrade from RC or Vista?
>
> Did you try to install to a different folder and without administrative rights?

Hi Luis,

I've just installed onto my brand new Windows 7 x64 machine and I'm
having this same problem. It's a totally clean install. I first
installed into C:\Ruby187 and when I started seeing this problem I
uninstalled and installed into C:\Users\charlesr\Tools\Ruby187. That
doesn't work either. If I launch an elevated console then that works.
I did a normal install using RubyInstaller 1.8.7 (2010-06-23
patchlevel 299) and have also tried installing from the 7zip archive.
Here's a gist:

http://gist.github.com/469695

Charles

http://gist.github.com/469695

Luis Lavena

unread,
Jul 9, 2010, 1:09:09 PM7/9/10
to rubyin...@googlegroups.com

What are you using as command prompt?

A clean install of Windows, or a formatted hard drive? The issue with
permissions seems to be related to NTFS, not Windows itself.

I've tried to recreate the issue 3 times (using clean installations on
VMs) and all worked.

What we could be missing here? Perhaps we should minimize the case to
a simple C code that tries to create a file/folder?

Roger Pack

unread,
Jul 9, 2010, 1:26:16 PM7/9/10
to rubyin...@googlegroups.com
> File exists - C:

Which file is it referring to?

Luis Lavena

unread,
Jul 9, 2010, 1:28:33 PM7/9/10
to rubyin...@googlegroups.com
On Fri, Jul 9, 2010 at 2:26 PM, Roger Pack <roger...@gmail.com> wrote:
>>    File exists - C:
>
> Which file is it referring to?
>

That's the think, tries to create ANY file inside C:

Is not C: the one tries to create, but all the other inside (see
FileUtils.mkdir_p)

Charles Roper

unread,
Jul 9, 2010, 2:09:36 PM7/9/10
to RubyInstaller


On Jul 9, 6:09 pm, Luis Lavena <luislav...@gmail.com> wrote:

> What are you using as command prompt?

I am generally using Console2 with TCC/LE, but I've also tried under
plain old cmd.exe and get exactly the same thing.

> A clean install of Windows, or a formatted hard drive? The issue with
> permissions seems to be related to NTFS, not Windows itself.

It's a brand new computer with a brand new hard disk.

> I've tried to recreate the issue 3 times (using clean installations on
> VMs) and all worked.
>
> What we could be missing here? Perhaps we should minimize the case to
> a simple C code that tries to create a file/folder?

I had considered it might be something to do with Cygwin. I've
installed E Text Editor, which also installs Cygwin by default. It's
not in the path, though, and is all safely contained in its c:\cygwin
folder, so I don't see how it can be affecting things elsewhere.

Charles

Charles Roper

unread,
Jul 9, 2010, 3:09:18 PM7/9/10
to RubyInstaller
On 9 July 2010 19:09, Charles Roper <charle...@gmail.com> wrote:

> I had considered it might be something to do with Cygwin. I've
> installed E Text Editor, which also installs Cygwin by default. It's
> not in the path, though, and is all safely contained in its c:\cygwin
> folder, so I don't see how it can be affecting things elsewhere.

Thinking about it, you can test for this quite easily. Just install
the E Text Editor trial, run it and let it install Cygwin using the
'automatic' setting. I could have sworn I installed a couple of gems
before I installed e, but I can't be positive whether I was in an
elevated console when I installed them. I notice a couple of other
people suffering from this have also mentioned Cygwin. Could it be
changing permissions when it installs? This is what I get when I do
icacls on C:\

[C:\]icacls \
\ 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)

According to the MS article, this looks correct.

Charles

Charles Roper

unread,
Jul 9, 2010, 6:37:51 PM7/9/10
to RubyInstaller
I've just tried JRuby and IronRuby - both work fine. So this only
seems to be affecting MRI. I've also tried with Ruby 1.9.1 and get a
slightly different error:

[C:\Users\charlesr]gem install rake
ERROR: While executing gem ... (Errno::ENOENT)


No such file or directory -

C:/Users/charlesr/.gem/ruby/1.9.1/cache/rake-0.8.7.gem

Charles

Roger Pack

unread,
Jul 9, 2010, 7:37:53 PM7/9/10
to rubyin...@googlegroups.com
> [C:\Users\charlesr]gem install rake
> ERROR:  While executing gem ... (Errno::ENOENT)
>    No such file or directory -
> C:/Users/charlesr/.gem/ruby/1.9.1/cache/rake-0.8.7.gem

I assume the file exists? If you do an exists and read from it within
irb does it work?
-r

Charles Roper

unread,
Jul 10, 2010, 4:49:42 AM7/10/10
to rubyin...@googlegroups.com

No, it didn't exists. I did a gem sources -c and that seemed to 'fix'
things to the point where it's now giving me the same error as 1.8.7:

http://gist.github.com/470577

Charles

Luis Lavena

unread,
Jul 10, 2010, 10:25:03 AM7/10/10
to rubyin...@googlegroups.com
On Fri, Jul 9, 2010 at 4:09 PM, Charles Roper <charle...@gmail.com> wrote:
> On 9 July 2010 19:09, Charles Roper <charle...@gmail.com> wrote:
>
>> I had considered it might be something to do with Cygwin. I've
>> installed E Text Editor, which also installs Cygwin by default. It's
>> not in the path, though, and is all safely contained in its c:\cygwin
>> folder, so I don't see how it can be affecting things elsewhere.
>
> Thinking about it, you can test for this quite easily. Just install
> the E Text Editor trial, run it and let it install Cygwin using the
> 'automatic' setting. I could have sworn I installed a couple of gems
> before I installed e, but I can't be positive whether I was in an
> elevated console when I installed them. I notice a couple of other
> people suffering from this have also mentioned Cygwin. Could it be
> changing permissions when it installs? This is what I get when I do
> icacls on C:\
>

BINGO!

We have a winner!

C:\Users\Luis>ruby -v
ruby 1.8.7 (2010-06-23 patchlevel 299) [i386-mingw32]

C:\Users\Luis>gem install rake


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

This happens after installing E with cygwin.

E is in the PATH, let me look any file dumped by cygwin.

C:\Users\Luis>path
PATH=C:\Users\Luis\.gem\ruby\x86-mingw32\1.8\bin;C:\Users\Luis\Tools\Ruby\ruby-1.8.7-p299-i386-mingw32\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program
Files (x86)\e\cmd;C:\Users\Luis\Tools\bin;C:\Users\Luis\Tools\Git\cmd;C:\Users\Luis\Tools\Svn\bin;C:\Users\Luis\Tools\Hg;C:\Users\Luis\Tools\Unix\bin;C:\Users\Luis\Tools\Vim;C:\Program
Files (x86)\Java\jdk1.6.0_18\bin

....

More to come.

Luis Lavena

unread,
Jul 10, 2010, 10:29:22 AM7/10/10
to rubyin...@googlegroups.com
On Sat, Jul 10, 2010 at 11:25 AM, Luis Lavena <luisl...@gmail.com> wrote:
>
> BINGO!
>
> We have a winner!
>
> C:\Users\Luis>ruby -v
> ruby 1.8.7 (2010-06-23 patchlevel 299) [i386-mingw32]
>
> C:\Users\Luis>gem install rake
> ERROR:  While executing gem ... (Errno::EEXIST)
>    File exists - C:
>
> This happens after installing E with cygwin.
>
> E is in the PATH, let me look any file dumped by cygwin.
>
> C:\Users\Luis>path
> PATH=C:\Users\Luis\.gem\ruby\x86-mingw32\1.8\bin;C:\Users\Luis\Tools\Ruby\ruby-1.8.7-p299-i386-mingw32\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program
> Files (x86)\e\cmd;C:\Users\Luis\Tools\bin;C:\Users\Luis\Tools\Git\cmd;C:\Users\Luis\Tools\Svn\bin;C:\Users\Luis\Tools\Hg;C:\Users\Luis\Tools\Unix\bin;C:\Users\Luis\Tools\Vim;C:\Program
> Files (x86)\Java\jdk1.6.0_18\bin
>
> ....
>


Check this out:

irb(main):001:0> require 'fileutils'
=> true
irb(main):002:0> p =
"C:/Users/Luis/.gem/ruby/x86-mingw32/1.8/gems/rake-0.8.7/lib/rake"
=> "C:/Users/Luis/.gem/ruby/x86-mingw32/1.8/gems/rake-0.8.7/lib/rake"
irb(main):003:0> FileUtils.mkdir_p p
Errno::EEXIST: File exists - C:
from C:/Users/Luis/Tools/Ruby/ruby-1.8.7-p299-i386-mingw32/lib/ruby/1.8/fileutils.rb:243:in
`mkdir'
from C:/Users/Luis/Tools/Ruby/ruby-1.8.7-p299-i386-mingw32/lib/ruby/1.8/fileutils.rb:243:in
`fu_mkdir'
from C:/Users/Luis/Tools/Ruby/ruby-1.8.7-p299-i386-mingw32/lib/ruby/1.8/fileutils.rb:217:in
`mkdir_p'
from C:/Users/Luis/Tools/Ruby/ruby-1.8.7-p299-i386-mingw32/lib/ruby/1.8/fileutils.rb:215:in
`reverse_each'
from C:/Users/Luis/Tools/Ruby/ruby-1.8.7-p299-i386-mingw32/lib/ruby/1.8/fileutils.rb:215:in
`mkdir_p'
from C:/Users/Luis/Tools/Ruby/ruby-1.8.7-p299-i386-mingw32/lib/ruby/1.8/fileutils.rb:201:in
`each'
from C:/Users/Luis/Tools/Ruby/ruby-1.8.7-p299-i386-mingw32/lib/ruby/1.8/fileutils.rb:201:in
`mkdir_p'
from (irb):3


But:

irb(main):004:0> FileUtils.mkdir_p "C:/Foo"
=> "C:/Foo"

And:

irb(main):005:0> FileUtils.mkdir_p "C:/Foo/Bar/baz"
Errno::EEXIST: File exists - C:
from C:/Users/Luis/Tools/Ruby/ruby-1.8.7-p299-i386-mingw32/lib/ruby/1.8/fileutils.rb:243:in
`mkdir'
from C:/Users/Luis/Tools/Ruby/ruby-1.8.7-p299-i386-mingw32/lib/ruby/1.8/fileutils.rb:243:in
`fu_mkdir'
from C:/Users/Luis/Tools/Ruby/ruby-1.8.7-p299-i386-mingw32/lib/ruby/1.8/fileutils.rb:217:in
`mkdir_p'
from C:/Users/Luis/Tools/Ruby/ruby-1.8.7-p299-i386-mingw32/lib/ruby/1.8/fileutils.rb:215:in
`reverse_each'
from C:/Users/Luis/Tools/Ruby/ruby-1.8.7-p299-i386-mingw32/lib/ruby/1.8/fileutils.rb:215:in
`mkdir_p'
from C:/Users/Luis/Tools/Ruby/ruby-1.8.7-p299-i386-mingw32/lib/ruby/1.8/fileutils.rb:201:in
`each'
from C:/Users/Luis/Tools/Ruby/ruby-1.8.7-p299-i386-mingw32/lib/ruby/1.8/fileutils.rb:201:in
`mkdir_p'
from (irb):5

Uninstalling E and cygwin now...

Luis Lavena

unread,
Jul 10, 2010, 10:38:22 AM7/10/10
to rubyin...@googlegroups.com
On Sat, Jul 10, 2010 at 11:29 AM, Luis Lavena <luisl...@gmail.com> wrote:
>
> Uninstalling E and cygwin now...

That didn't help, better information here:

https://gist.github.com/047915f46a88eb11dfcb


And simple step to reproduce the issue, a recursive directory:

irb(main):001:0> require 'fileutils'
=> true

irb(main):002:0> FileUtils.mkdir_p "C:/Foo/bar/baz"


Errno::EEXIST: File exists - C:
from C:/Users/Luis/Tools/Ruby/ruby-1.8.7-p299-i386-mingw32/lib/ruby/1.8/fileutils.rb:243:in
`mkdir'
from C:/Users/Luis/Tools/Ruby/ruby-1.8.7-p299-i386-mingw32/lib/ruby/1.8/fileutils.rb:243:in
`fu_mkdir'
from C:/Users/Luis/Tools/Ruby/ruby-1.8.7-p299-i386-mingw32/lib/ruby/1.8/fileutils.rb:217:in
`mkdir_p'
from C:/Users/Luis/Tools/Ruby/ruby-1.8.7-p299-i386-mingw32/lib/ruby/1.8/fileutils.rb:215:in
`reverse_each'
from C:/Users/Luis/Tools/Ruby/ruby-1.8.7-p299-i386-mingw32/lib/ruby/1.8/fileutils.rb:215:in
`mkdir_p'
from C:/Users/Luis/Tools/Ruby/ruby-1.8.7-p299-i386-mingw32/lib/ruby/1.8/fileutils.rb:201:in
`each'
from C:/Users/Luis/Tools/Ruby/ruby-1.8.7-p299-i386-mingw32/lib/ruby/1.8/fileutils.rb:201:in
`mkdir_p'

from (irb):2

Something got changed in C: that is making FileUtils fail, and is not
permissions.

Luis Lavena

unread,
Jul 10, 2010, 10:44:23 AM7/10/10
to rubyin...@googlegroups.com
On Sat, Jul 10, 2010 at 11:38 AM, Luis Lavena <luisl...@gmail.com> wrote:
> [...]

I swear, last email:

irb(main):006:0> FileUtils.mkdir_p "C:\\1\\2\\3"


Errno::EEXIST: File exists - C:\
from C:/Users/Luis/Tools/Ruby/ruby-1.8.7-p299-i386-mingw32/lib/ruby/1.8/fileutils.rb:243:in
`mkdir'
from C:/Users/Luis/Tools/Ruby/ruby-1.8.7-p299-i386-mingw32/lib/ruby/1.8/fileutils.rb:243:in
`fu_mkdir'
from C:/Users/Luis/Tools/Ruby/ruby-1.8.7-p299-i386-mingw32/lib/ruby/1.8/fileutils.rb:217:in
`mkdir_p'
from C:/Users/Luis/Tools/Ruby/ruby-1.8.7-p299-i386-mingw32/lib/ruby/1.8/fileutils.rb:215:in
`reverse_each'
from C:/Users/Luis/Tools/Ruby/ruby-1.8.7-p299-i386-mingw32/lib/ruby/1.8/fileutils.rb:215:in
`mkdir_p'
from C:/Users/Luis/Tools/Ruby/ruby-1.8.7-p299-i386-mingw32/lib/ruby/1.8/fileutils.rb:201:in
`each'
from C:/Users/Luis/Tools/Ruby/ruby-1.8.7-p299-i386-mingw32/lib/ruby/1.8/fileutils.rb:201:in
`mkdir_p'

from (irb):6
irb(main):007:0> File.stat("C:/")
Errno::EACCES: Permission denied - C:/
from (irb):7:in `stat'
from (irb):7
irb(main):008:0> File.stat("C:/Foo")
=> #<File::Stat dev=0x2, ino=0, mode=040755, nlink=1, uid=0, gid=0,
rdev=0x2, size=0, blksize=nil, blocks=nil, atime=Wed Dec 31 21:00:00
-0300 1969, mtime=Wed Dec 31 21:00:00 -0300 1969, ctime=Wed Dec 31
21:00:00 -0300 1969>
irb(main):009:0> File.stat("C:/1")
Errno::ENOENT: No such file or directory - C:/1
from (irb):9:in `stat'
from (irb):9
irb(main):010:0> File.exist?("C:\\")
=> false
irb(main):011:0> File.exist?("C:/")
=> false

Any hint?

My brain is burnt from a hell of week I had, so don't expect me find
the root of this today :-P

Luis Lavena

unread,
Jul 10, 2010, 12:24:45 PM7/10/10
to rubyin...@googlegroups.com
On Sat, Jul 10, 2010 at 11:44 AM, Luis Lavena <luisl...@gmail.com> wrote:
> On Sat, Jul 10, 2010 at 11:38 AM, Luis Lavena <luisl...@gmail.com> wrote:
>> [...]
>
> I swear, last email:
>

I lied, last, really last email.

Issue seems to be RubyGems. RubyGems uses HOME, USERPROFILE or
HOMEDRIVE + HOMEPATH for setting Gem.user_home directory.

The problem with that is the following:

require 'fileutils'
FileUtils.mkdir_p "C:\\Foo\\Bar" # this fails
FileUtils.mkdir_p "C:/Foo/Bar" # this too, but for different reasons,
keep reading.

fu_mkdir is changing path locally but then, on SystemCallError rescue,
is been checked against the non modified version.

So:

"C:/" is feed into fu_mkdir
"C:/" is sanitized to "C:"
Dir.mkdir is tried with "C:" and fails
Exception is rescued and raised unless "C:/" is a directory already.

C:/ is not a directory:
irb(main):001:0> File.directory?("C:/") # => false

C: *is* a directory:
irb(main):003:0> File.directory?("C:")
=> true

So, two fixes here:

RubyGems should expand all the defined homes. Creating a ticket for that.

FileUtils minimal change:

from:
path = path.sub(%r</\z>, '')

to:
path.sub!(%r</\z>, '')

Dunno the real source of these errors, but I think I found what could
be the issue.

Thoughts?

Charles Roper

unread,
Jul 10, 2010, 6:29:59 PM7/10/10
to rubyin...@googlegroups.com
I think the broken permissions might be on %LOCALAPPDATA%\VirtualStore:

http://gist.github.com/471078

If I add my own user with full control permissions, I can install gems
again. Could someone who has a working system let us know what the
default permissions are on VirtualStore?

Charles

Luis Lavena

unread,
Jul 10, 2010, 6:36:33 PM7/10/10
to rubyin...@googlegroups.com

http://gist.github.com/471087

Is e-editor changing that? That is plain wrong!

That could be the problem with File.stat('C:/') as WOW64 redirection
is working for 32bits applications...

Charles Roper

unread,
Jul 10, 2010, 6:54:58 PM7/10/10
to rubyin...@googlegroups.com
On 10 July 2010 23:36, Luis Lavena <luisl...@gmail.com> wrote:

> http://gist.github.com/471087
>
> Is e-editor changing that? That is plain wrong!

Either e or Cygwin - not sure. I'll contact e's author and let him
know this is happening. Are you able to test installing Cygwin
normally, without installing e?

> That could be the problem with File.stat('C:/') as WOW64 redirection
> is working for 32bits applications...

Looks like anything that touches C:\ makes Windows Virtualization
kick-in which then fails because the permissions on VirtualStore got
broken during e install.

Charles

Luis Lavena

unread,
Jul 10, 2010, 6:58:39 PM7/10/10
to rubyin...@googlegroups.com
On Sat, Jul 10, 2010 at 7:54 PM, Charles Roper
<rea...@charlesroper.co.uk> wrote:
> On 10 July 2010 23:36, Luis Lavena <luisl...@gmail.com> wrote:
>
>> http://gist.github.com/471087
>>
>> Is e-editor changing that? That is plain wrong!
>
> Either e or Cygwin - not sure. I'll contact e's author and let him
> know this is happening. Are you able to test installing Cygwin
> normally, without installing e?
>

I had a working cygwin before, so is not that. Also e do not install
cygwin in C:\ but inside it's program files folder.

Found this:

http://support.microsoft.com/kb/927387

And after showing all files, went to %LOCALAPPDATA%, Right click in
VirtualStore, Security settings and then in advanced selected to
inherit the permissions from the parent object.

Click ok and things started to work again:

C:\Users\Luis\Projects\oss\ruby>ruby -e "puts File.stat('C:/')"
#<File::Stat:0x43c5e70>

Either was cygwin or e, but I'm sticking with SublimeText...

Charles Roper

unread,
Jul 10, 2010, 7:11:51 PM7/10/10
to RubyInstaller
On Jul 10, 11:58 pm, Luis Lavena <luislav...@gmail.com> wrote:

> http://support.microsoft.com/kb/927387
>
> And after showing all files, went to %LOCALAPPDATA%, Right click in
> VirtualStore, Security settings and then in advanced selected to
> inherit the permissions from the parent object.
>
> Click ok and things started to work again:

That's what I found and also did to fix. Things are working again for
me now.

> Either was cygwin or e, but I'm sticking with SublimeText...

I've posted a message to the author - hopefully he should release a
fix soon.

Charles

Luis Lavena

unread,
Jul 10, 2010, 7:13:02 PM7/10/10
to rubyin...@googlegroups.com
On Sat, Jul 10, 2010 at 8:11 PM, Charles Roper <charle...@gmail.com> wrote:
> I've posted a message to the author - hopefully he should release a
> fix soon.
>

Added a small note to the wiki:

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

Charles Roper

unread,
Jul 13, 2010, 2:31:23 AM7/13/10
to rubyin...@googlegroups.com
The author of E, Alexander Stigsen, is now aware of this problem. It's
caused by a bash script that is run during installation. Here's the
culprit:

chmod o-w `cygpath $HOMEDRIVE`

Apparently when cygwin sets permissions, it makes a mess of the ACL
permissions.

There's also a thread on the E forum about it:

http://www.e-texteditor.com/forum/viewtopic.php?t=3715

Charles

Solidify

unread,
Jul 17, 2010, 7:42:01 PM7/17/10
to RubyInstaller
Guys, you are awesome. That fixed the problem. By the way: also on a
32bit Windows 7. Wonderful!!!

Victor Stan

unread,
Jul 8, 2011, 2:16:08 PM7/8/11
to rubyin...@googlegroups.com
I am still having this problem I have windows 7 pro 64 bit

Luis Lavena

unread,
Jul 8, 2011, 3:13:03 PM7/8/11
to rubyin...@googlegroups.com
On Fri, Jul 8, 2011 at 3:16 PM, Victor Stan <victo...@gmail.com> wrote:
> I am still having this problem I have windows 7 pro 64 bit
>

Victor, have you tried setting the environment variables as instructed
several messages back?

What does HOME, HOMEDRIVE, HOMEPATH, USERPROFILE variable say?

E.g., on my system:

C:\Users\Luis>set HOMEDRIVE
HOMEDRIVE=C:

What the other variables says in yours?

What "gem env" outputs?

Reply all
Reply to author
Forward
0 new messages