Reputation: 1
I've installed the latest version of ruby (1.9.2)
I've got the version 1.7.2 of gem.
I'm on a Win7 64bit and I run my prompt as administrator.
The fact is that I can not update or install new gems.
I have always the same error : "Error : While executing gem... (Errno:EN0ENT)
No such file or directory - C/Users/David Well what can I do ?? Thanks
Upvotes: 0
Views: 317
Reputation: 2260
When using rubygems on Windows there's a couple of things that are handy to know first.
Mainly, the order in which rubygems looks through your computer for where gems are installed. This may have been fixed in more recent versions of rubygems but I know older versions used to trip up here occasionally.
Check out the following page for the specs, I found this page incredibly helpful in understanding where rubygems is looking for your gems.
http://docs.rubygems.org/read/chapter/12
Judging from the error you've pasted.. When using Windows, Users are automatically assigned a HOMEPATH or a USERPROFILE variable which is where your my Documents folders and stuff are usually stored. In the order in which rubygems is looking for your gem paths, these are actually pretty high on the list of places to look and if either of them has been defined it thinks your gems should be in there.
I run into problems at work because my HOMEPATH is automatically set to a networked drive every time I connect my computer and when I take my computer home it craps itself looking for my gems on the network path.
There's a couple of different ways to fix it, but I think the simplest way is to just create a HOME environment variable that points to a sub folder of the version of Ruby you're using.. so something like HOME=C:\ruby192\homepath and just create an empty folder at C:\ruby192\homepath
If you look at the link I sent you above you'll see that rubygems looks in HOME before HOMEPATH. If you try redefining HOMEPATH or USERPROFILE you'll notice a lot of problems the next time you restart Windows including the way Windows renders your desktop.. so leave those variables alone. You can check that you're not overwriting anything first on the command line by seeing if the variables have already been defined on your computer:
echo %HOMEPATH%
echo %HOME%
It's not the nicest of solutions but this works quite well, even with old versions of rubygems running on anything from XP to Win7 so up to you if you want to use it.
If you do all that hopefully you shouldn't run into any more problems installing gems.
Upvotes: 1