在Windows 7 64位上运行gem install时出错 [英] Error running gem install on Windows 7 64 bit
问题描述
我刚刚使用rubyinstaller.org的安装程序安装了ruby 1.9.2-p136,现在我正在尝试安装rails。当我做gem install rails时,出现以下错误:
I just installed ruby 1.9.2-p136 using the installer from rubyinstaller.org and now I am trying to install rails. When I do "gem install rails" I get the following error:
C:\Users\Clayton.USA>gem install rails
ERROR: While executing gem ... (Errno::EINVAL)
Invalid argument - P:/
下面是我正在运行的ruby和gem版本:
Here are the ruby and gem versions I'm running:
C:\Users\Clayton.USA>ruby -v
ruby 1.9.2p136 (2010-12-25) [i386-mingw32]
C:\Users\Clayton.USA>gem -v
1.3.7
更新:在此找到解决方案:如何停止'宝石'实用工具访问我的主目录?
Update: found the solution here: How to stop the 'gem' utility from accessing my home directory?
将以下内容添加到我的bin / gem开头:
Added the following to the start of my bin/gem:
ENV['HOME'] = "D:/Ruby192"
推荐答案
在我的情况下,从命令提示符运行以下命令将homedrive修正为c:并修复了gem更新问题
SET HOMEDRIVE = c:
In my case running following command from command prompt fixed the homedrive to c: and fixed the gem update issue
SET HOMEDRIVE=c:
您的HOMEDRIVE设置为P :,在该命令之后,它将被设置为C:
,您可以通过编写
SET HOMEDRIVE
将其设置为C之前和之后进行测试:
your HOMEDRIVE was set to P:, after that command it will be set to C:
you can test by writing only
SET HOMEDRIVE
before and after setting it to C:
这篇关于在Windows 7 64位上运行gem install时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!