windows 安装 gem 时权限被拒绝错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5129572/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Permission denied error while installing gem
提问by demas
I am trying to install rackamole on Windows XP:
我正在尝试在 Windows XP 上安装 rackamole:
S:\development\DevKit>gem install rackamole
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: While executing gem ... (Errno::EACCES)
Permission denied - S:/development/Ruby/lib/ruby/gems/1.9.1/gems/rackamole-0.4.0/...
I have checked permission:
我已检查权限:
S:\development\DevKit>notepad S:\development\Ruby\lib\ruby\gems.9.1\gems\rackamole-0.4.0\some.txt
and didn't have any problem.
并且没有任何问题。
How can I install gem?
我该如何安装 gem?
采纳答案by aef
Installing C-extensions on Windows has always been a big and painful problem, as Windows doesn't ship with a compiler. Most gems which are intended to be used on Windows systems publish a specialized gem version with a specific platform field, which then would include pre-compiled binaries. This is not the case for rackamole, otherwise it would be visible here.
在 Windows 上安装 C 扩展一直是一个大而痛苦的问题,因为 Windows 不附带编译器。大多数打算在 Windows 系统上使用的 gem 发布了具有特定平台字段的专用 gem 版本,然后将包含预编译的二进制文件。这不是rackamole的情况,否则它会在这里可见。
Another solution would be to use a version of the gem which uses the newer FFI approach instead of C-extensions to interface with native libraries. I guess this isn't an option here because rackamole, whatever that is, is probably only available with C-extensions.
另一种解决方案是使用 gem 版本,该版本使用较新的 FFI 方法而不是 C 扩展来与本机库交互。我想这不是这里的一个选项,因为无论是什么,rackamole 可能只适用于 C 扩展。
There once was a Ruby distribution including its own compiler and development headers, but I can't remember the name and I don't know if its still maintained.
曾经有一个 Ruby 发行版,包括它自己的编译器和开发头文件,但我不记得它的名字,我不知道它是否还在维护。
Should using Windows not be mandatory, I recommend using a more developer-friendly OS like Ubuntuor Debianin combination with rvm.
回答by
Running the terminal as Administrator
user will solve this problem.
以Administrator
用户身份运行终端将解决此问题。
回答by Vic
I agree with Vlad Lazarenko comment. You don't need to add your account to the local admin group, just right click the terminal or command prompt and choose "run as administrator" and try again installing the rackamole.
我同意 Vlad Lazarenko 的评论。您不需要将您的帐户添加到本地管理员组,只需右键单击终端或命令提示符并选择“以管理员身份运行”并再次尝试安装rackamole。