【问题标题】:Installing Ruby Gems without access to the official repository在不访问官方存储库的情况下安装 Ruby Gems
【发布时间】:2011-04-25 13:30:37
【问题描述】:

我在办公室使用代理脚本连接到互联网。结果我的 命令提示符(Win XP)无法连接,我只能使用 浏览器。

是否有一些我可以手动安装一些我需要的 ruby​​ gem - 不使用

gem install 'abc'

或者有什么方法可以让我的命令提示符连接到互联网。 虽然我的 IE 设置确实使用脚本,但我仍然无法让 CMD 连接。

【问题讨论】:

  • 您好,如果我在一个目录中有这么多gem文件,如何在一个命令中安装所有gem而不单独指定它们的名称?

标签: rubygems


【解决方案1】:

我在狭窄的环境中工作时遇到了同样的问题。一个不错的解决方法是下载您对 USB 记忆棒感兴趣的 gem,然后手动安装。

这是您可以找到所有可用红宝石宝石的网站。 Ruby gems download。找到您感兴趣的并下载它。

然后将 gem 移动到您选择的目录中,然后从命令提示符 cd 进入该目录。 我正在使用C:/ruby193/bin/pony-1.4.gem

假设我们感兴趣的 gem 是 pony gem (smtp email)。

只需输入gem install pony-1.4.gem

你应该手动安装它,除非你有一个受限的ACC没有足够的管理权限。

【讨论】:

  • 这对我不起作用,我不得不使用 --local 和绝对路径。即:gem install --local C:\Ruby200\bin\sass-3.3.9.gem
  • @mburn7 我试过gem install --local C:/Ruby193/bin/ruby-termios-0.9.6.gem,但它给了我错误:Temporarily enhancing PATH to include DevKit... Building native extensions. This could take a while... ERROR: Error installing C:/Ruby193/bin/ruby-termios-0.9.6.gem: ERROR: Failed to build gem native extension. c:/Ruby193/bin/ruby.exe extconf.rb checking for termios.h... no *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details.You may need configuration options
【解决方案2】:

【讨论】:

  • 真是愚蠢的回答。如果我将它存储在 h:\a\b\c\d\e\f 你的命令会找到它吗?我之前在此链接中看到了您的答案,但无法理解如何安装它。
  • @Amir 帮助页面说您可以在安装命令之前更改目录。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-11-21
  • 2012-07-23
  • 2020-01-14
  • 2014-05-07
  • 2018-10-29
  • 2011-03-06
相关资源
最近更新 更多