I have two PCs, one with Windows XP and another with Windows Vista. I'm
working as an administrator in both computers. I'm using Ruby 1.8.7 and
Rubygems 1.3.6. When I try to install Rails I get this error:
C:\>gem install rails
ERROR: While executing gem ... (Errno::ENOENT)
No such file or directory - C:/Users/Jesús Dugarte
I have installed Rails several times before (although I haven't done it
in about a year), and I'd never had this problem before. Has anything
changed in the installation? I've found several cases similar to mine in
internet, but none of the proposed solutions works for me.
Try running Sysinternals Process Monitor and look for file system activity around the time the error occurs. Could give more details on why ruby can’t see that folder. (What’s the error msg on XP? That msg looks Vista specific).
Ruby is actually installed in the default directory, C:\Ruby, without
spaces o any other special character. And I don't have any problem
installing Ruby. It's Rails that I'm having problems with.
2) First download ruby. For windows it is one click installer
package just download it and double click it and follow installation
wizard.
3) Download ruby gems from same page, extract it and then run ruby
setup.rb, just double click it.
4) To install rails type �gem install rails� in terminal, it will
automatically install rails for you.
Yes, that's exactly what I did, and exactly what I've done many times in
the past, but this time it won't let me install Rails when I do "gem
install rails"
Try running Sysinternals Process Monitor and look for file system
activity
around the time the error occurs. Could give more details on why ruby
can't
see that folder. (What's the error msg on XP? That msg looks Vista
specific).
changed in the installation? I've found several cases similar to mine in
"Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com<rubyonrails-talk%2Bunsubscribe@googlegroups.com>
.
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.
I have two PCs, one with Windows XP and another with Windows Vista. I'm
working as an administrator in both computers. I'm using Ruby 1.8.7 and
Rubygems 1.3.6. When I try to install Rails I get this error:
C:\>gem install rails
ERROR: While executing gem ... (Errno::ENOENT)
No such file or directory - C:/Users/Jesús Dugarte
I have installed Rails several times before (although I haven't done it
in about a year), and I'd never had this problem before. Has anything
changed in the installation? I've found several cases similar to mine in
internet, but none of the proposed solutions works for me.
Thanks,
Jesús Dugarte.-
Using this
as a base, I manage to make it work. My gem.bat looks like this now:
@ECHO OFF
SET _HOMEPATH=%HOMEPATH%
SET HOMEPATH=\Ruby
IF NOT "%~f0" == "~f0" GOTO :WinNT
@"ruby.exe" "C:\Ruby\bin\gem" %1 %2 %3 %4 %5 %6 %7 %8 %9
GOTO :EOF
:WinNT
@"ruby.exe" "%~dpn0" %*
:EOF
SET HOMEPATH=%_HOMEPATH%
Although I'm now wondering if there will be any unexpected consequence
of having the .gem directory inside the ruby directory (C:\Ruby) and not
where it used to be (C:\Users\Jesús Dugarte).
The error appears because of Gem#find_home(rubygems.rb line 498) method
not working with unicode characters which can be present in your homedir
path(and in your case they definitely are).
That method reads the followig environment variables: 'HOME',
'USERPROFILE', ['HOMEDRIVE'+'HOMEPATH'].
This homepath is used to define @update_cache variable(spec_fetcher.rb
line 46):
@update_cache = File.stat(Gem.user_home).uid == Process.uid
with related consequences.
I think you should reset your gem.bat to default and only use your
version when needed.
Also you can just undefine HOMEPATH environment variable before using
gem utility:
(windows -- Start->Run->cmd)
set HOMEPATH=
gem install <somegem>
<...>
After closing cmd-session this variable would be set to default
automatically.
The error appears because of Gem#find_home(rubygems.rb line 498) method
not working with unicode characters which can be present in your homedir
path(and in your case they definitely are).
That method reads the followig environment variables: 'HOME',
'USERPROFILE', ['HOMEDRIVE'+'HOMEPATH'].
This homepath is used to define @update_cache variable(spec_fetcher.rb
line 46):
@update_cache = File.stat(Gem.user_home).uid == Process.uid
with related consequences.
I think you should reset your gem.bat to default and only use your
version when needed.
Also you can just undefine HOMEPATH environment variable before using
gem utility:
(windows -- Start->Run->cmd)
set HOMEPATH=
gem install <somegem>
<...>
After closing cmd-session this variable would be set to default
automatically.
Thank you, Nikolay, for the detailed explanation. I created a mygem.bat
with my version, to use it in case the regular gem.bat doesn't work. I
hope this won't get me in any more troubles