RVM - 有没有简单的离线安装方法?

发布于 2024-10-26 08:38:24 字数 273 浏览 6 评论 0原文

我想在离线计算机中安装 RVM - 我可以手动传输所需的任何文件,但不可能有互联网连接。当尝试下载 ruby​​ 或其他依赖项(zlib 等)的源文件时,不在线会导致 RVM 崩溃。

我正在寻找一种将 RVM 指向 ruby​​ 源文件夹位置的方法,例如 rvm install 1.8.7 --source=/path/to/ruby-1.8.7-p330/ ,或任何其他依赖项。我已经搜索了 rvm 文档,但要么遗漏了某些内容,要么不存在。也欢迎任何有关如何完成此安装的其他建议。谢谢。

I would like to install RVM in an offline machine - I can manually transfer any file needed, but it'll be impossible to have an internet connection. Not being online causes RVM to collapse when trying to download source files for ruby or other dependencies (zlib, etc).

I'm looking for a way to point RVM to the location of ruby source folder, e.g. something like rvm install 1.8.7 --source=/path/to/ruby-1.8.7-p330/, or any other dependencies. I've scoured the rvm docs but either missed something or it's not there. Any other suggestions as to how to accomplish this installation are also welcome. thanks.

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

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

发布评论

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

评论(4

甜是你 2024-11-02 08:38:24

当 rvm 下载 ruby​​ 版本时,会将其保存到 .rvm/archives。因此,您可以将 ruby​​ 的 .tar.bz2 源放入该目录中,rvm 将使用它而不是尝试下载它:

cp ruby-1.8.7-p330.tar.bz2 ~/.rvm/archives/
rvm install ruby-1.8.7

When rvm downloads a version of ruby it saves it to .rvm/archives. So you can drop the .tar.bz2 source of ruby into that directory and rvm will use that instead of trying to download it:

cp ruby-1.8.7-p330.tar.bz2 ~/.rvm/archives/
rvm install ruby-1.8.7
儭儭莪哋寶赑 2024-11-02 08:38:24

使用相同的用户帐户设置第二台计算机(源),并使用该计算机安装 RVM、安装 Ruby 和您需要的所有 Gem...

然后,一旦安装了您需要的所有东西,请使用 rsync 复制从源计算机到离线计算机的完整 ~/.rvm 目录。 rsync 是你的朋友!

如果离线计算机上没有互联网连接,请使用闪存驱动器,并使用“cp -rp”将所有内容复制到闪存驱动器 - 然后复制到离线计算机上。

注意:两台机器上的用户帐户名称必须相同!

如果您不使用相同的用户名,稍后您会遇到一些奇怪的错误消息... RVM 会记住安装 gem 或 ruby​​ 版本的完整路径 - 它不使用 $HOME 变量。如果您在所有计算机上使用相同的用户帐户进行部署,则不会看到这些错误。

set up a second machine (source) with identical user account, and use that machine to install RVM, to install Ruby and all the Gems you need...

Then, once you have installed all the things you need, use rsync to copy the complete ~/.rvm directory from your source machine to your offline machine. rsync is your friend!

If you don't have an internet connection on the offline machine, use a flash drive, and copy everything with 'cp -rp' to the flash drive -- then onto the offline machine.

Note: the name of the user account has to be the same on both machines!

If you don't use the same user names, you will run into some weird error messages later... RVM memorizes the complete path where a gem or ruby version was installed -- it doesn't use the $HOME variable. If you use the same user account on all machines for deployment, you won't see those errors.

权谋诡计 2024-11-02 08:38:24

也许这不是最简单的,但 RVM 提供了离线安装的文档: http://rvm.io/rvm/offline< /a> - 它还包括如何离线部署应用程序的信息。

Maybe it is not the simplest but RVM provides documentation for the offline installation: http://rvm.io/rvm/offline - it also includes information how to deploy your application offline.

鲜血染红嫁衣 2024-11-02 08:38:24

也需要这方面的帮助,我太穷了,无法发表评论。

上述解决方案均无效。 RVM 离线文档根本没有帮助。无论我做什么,它都想从源代码安装,这没有帮助

如何提示或强制 RVM 使用全局存档目录?

也许问题是:一旦 ruby​​ 树就位,如何告诉 RVM 它在那里并且可以使用?

找到了答案。

按照 rvm 站点的建议,将二进制文件放入档案目录中,然后挂载它。:

cp rvm-binary-2.x.x-pyyy.tar.bz2 /usr/local/rvm/archives/ # or whichever
rvm mount -r /usr/local/rvm/archives/rvm-binary-2.x.x-pyyy.tar.bz2

现在您可能会得到如下输出:

/usr/local/rvm/archives/bin-ruby-2.0.0-p598.tar.bz2 - #configure
ruby-2.0.0-p598 - #download
ruby-2.0.0-p598 - #validate archive
ruby-2.0.0-p598 - #extract
ruby-2.0.0-p598 - #validate binary
Libraries missing for ruby-2.0.0-p598: libyaml-0.so.2. Refer to your system manual for installing libraries

表明您正在在正确的轨道上。安装 yaml 后,我重做 rvm mount -r 操作并得到:

/usr/local/rvm/archives/bin-ruby-2.0.0-p598.tar.bz2 - #configure
ruby-2.0.0-p598 - #download
ruby-2.0.0-p598 - #validate archive
ruby-2.0.0-p598 - #extract
ruby-2.0.0-p598 - #validate binary
ruby-2.0.0-p598 - #setup
ruby-2.0.0-p598 - #gemset created /usr/local/rvm/gems/ruby-2.0.0-p598@global
ruby-2.0.0-p598 - #importing gemset /usr/local/rvm/gemsets/global.gems..............................
ruby-2.0.0-p598 - #generating global wrappers........
ruby-2.0.0-p598 - #gemset created /usr/local/rvm/gems/ruby-2.0.0-p598
ruby-2.0.0-p598 - #importing gemsetfile /usr/local/rvm/gemsets/default.gems evaluated to empty gem list
ruby-2.0.0-p598 - #generating default wrappers........

之后我验证:
rvm 使用 2.0.0-p598

我们就可以开始了。

Also need help with this, and I'm too poor to comment.

None of the above solutions work. The RVM-offline doc doesn't help at all. No matter what I do, it wants to install from source, which is not helping.

How do I hint or force RVM to use the global archives directory?

Maybe the question is: once the ruby tree is in place, how to tell RVM that it's there and can be used?

Found the answer.

Put the binary in the archives directory, as suggested by the rvm site, then mount it.:

cp rvm-binary-2.x.x-pyyy.tar.bz2 /usr/local/rvm/archives/ # or whichever
rvm mount -r /usr/local/rvm/archives/rvm-binary-2.x.x-pyyy.tar.bz2

Now you might get output like this:

/usr/local/rvm/archives/bin-ruby-2.0.0-p598.tar.bz2 - #configure
ruby-2.0.0-p598 - #download
ruby-2.0.0-p598 - #validate archive
ruby-2.0.0-p598 - #extract
ruby-2.0.0-p598 - #validate binary
Libraries missing for ruby-2.0.0-p598: libyaml-0.so.2. Refer to your system manual for installing libraries

showing that you are on the right track. After installing yaml, I redo the rvm mount -r op and get:

/usr/local/rvm/archives/bin-ruby-2.0.0-p598.tar.bz2 - #configure
ruby-2.0.0-p598 - #download
ruby-2.0.0-p598 - #validate archive
ruby-2.0.0-p598 - #extract
ruby-2.0.0-p598 - #validate binary
ruby-2.0.0-p598 - #setup
ruby-2.0.0-p598 - #gemset created /usr/local/rvm/gems/ruby-2.0.0-p598@global
ruby-2.0.0-p598 - #importing gemset /usr/local/rvm/gemsets/global.gems..............................
ruby-2.0.0-p598 - #generating global wrappers........
ruby-2.0.0-p598 - #gemset created /usr/local/rvm/gems/ruby-2.0.0-p598
ruby-2.0.0-p598 - #importing gemsetfile /usr/local/rvm/gemsets/default.gems evaluated to empty gem list
ruby-2.0.0-p598 - #generating default wrappers........

After which I verify:
rvm use 2.0.0-p598

And we're good to go.

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