有没有办法离线更新RubyGems?

时间:2021-12-06 07:16:24

I am trying to install Ruby + WATIR to a Windows server which is in an isolated environment. Typically I would run the ruby installer followed by these two commands:

我正在尝试将Ruby + WATIR安装到处于隔离环境中的Windows服务器上。通常我会运行ruby安装程序,然后执行以下两个命令:

1) gem update --system

1)gem update --system

2) gem install watir

2)gem install watir

This is as per the instuctions here

这是根据这里的指示

The server I am now trying to install to does not have internet connectivity. This causes the commands above to fail.

我现在尝试安装的服务器没有互联网连接。这会导致上述命令失败。

Is there a way I can download the update packages required and copy them to the server to install locally?

有没有办法可以下载所需的更新包并将它们复制到服务器以在本地安装?

2 个解决方案

#1


9  

When you do gem install it will search the current directory before looking to the remote source. You must specify the version if you are installing a local gem (see rubygems manual).

当您进行gem安装时,它将在查找远程源之前搜索当前目录。如果要安装本地gem,则必须指定版本(请参阅rubygems手册)。

gem install copland-0.2.0.gem

I'm sorry, I don't know a way to update the gem system offline without doing a manual upgrade

对不起,我不知道如何在不进行手动升级的情况下离线更新gem系统

#2


0  

I usually use

我经常使用

gem unpack blah-1.1.1.gem

to unpack the gem into individual Ruby files. Then you just need to make sure that directory is in your Ruby load path, and it's as good as a normal gem.

将gem解压缩到单个Ruby文件中。然后你只需要确保目录在你的Ruby加载路径中,它就像普通的gem一样好。

#1


9  

When you do gem install it will search the current directory before looking to the remote source. You must specify the version if you are installing a local gem (see rubygems manual).

当您进行gem安装时,它将在查找远程源之前搜索当前目录。如果要安装本地gem,则必须指定版本(请参阅rubygems手册)。

gem install copland-0.2.0.gem

I'm sorry, I don't know a way to update the gem system offline without doing a manual upgrade

对不起,我不知道如何在不进行手动升级的情况下离线更新gem系统

#2


0  

I usually use

我经常使用

gem unpack blah-1.1.1.gem

to unpack the gem into individual Ruby files. Then you just need to make sure that directory is in your Ruby load path, and it's as good as a normal gem.

将gem解压缩到单个Ruby文件中。然后你只需要确保目录在你的Ruby加载路径中,它就像普通的gem一样好。