没有网络的情况下安装gem

发布于 2025-01-12 09:13:46 字数 768 浏览 3 评论 0原文

我必须在没有互联网连接的机器上安装几个 gem 文件。为此,我从连接到互联网的计算机导入了包,并将文件复制到离线计算机。我按照这个指南进行安装,但它已弃用。事实上,结果如下:

gem install --force --local *.gem
ERROR:  Could not find a valid gem '*.gem' (>= 0) in any repository

我的问题是:在没有网络的情况下如何安装这20/30种不同的gem?还有别的办法吗?

谢谢你!

更新: 我再次尝试逐文件夹安装 gem,首先使用“gem build”,然后使用“gem install”。 结果:

WARNING:  Unable to pull data from 'https://rubygems.org/': Errno::ENETUNREACH: Failed to open TCP connection to rubygems.org:443 (Network is unreachable - connect(2) for "rubygems.org" port 443) (https://rubygems.org/specs.4.8.gz)
1 gem installed

可能是代理问题?

I have to install several gem files on a machine that does NOT have an internet connection. To do this, I imported the packages from a machine that is connected to the internet and copied the files to the offline machine. I followed this guide for the installation, but it is deprecated. In fact, the result is as follows:

gem install --force --local *.gem
ERROR:  Could not find a valid gem '*.gem' (>= 0) in any repository

My question is: how can I install these 20/30 different gems without internet? Is there another way?

Thank you!

Update:
I tried again folder by folder to install the gems, first with "gem build" and then "gem install".
The result:

WARNING:  Unable to pull data from 'https://rubygems.org/': Errno::ENETUNREACH: Failed to open TCP connection to rubygems.org:443 (Network is unreachable - connect(2) for "rubygems.org" port 443) (https://rubygems.org/specs.4.8.gz)
1 gem installed

Could be a proxy problem?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

冬天的雪花 2025-01-19 09:13:46

找到了解决方案。
基本上有2个问题:
如果我想从 gem 文件夹安装 gem,我必须首先运行构建并在安装之后运行。
但我也可以安装放置在缓存文件夹内的 gem,并在该文件夹内直接运行“gem install --force --local”。
谢谢大家的回答。

Found the solution.
Basically 2 Problems:
If i wanted to install the gems from the gem folder, i had first to run the build and after the install.
But i could also install the gems placed inside the cache folder, and inside this folder run directly "gem install --force --local".
Thank you all of you for your answers.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文