RVM - 有没有简单的离线安装方法?
我想在离线计算机中安装 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
当 rvm 下载 ruby 版本时,会将其保存到 .rvm/archives。因此,您可以将 ruby 的 .tar.bz2 源放入该目录中,rvm 将使用它而不是尝试下载它:
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:
使用相同的用户帐户设置第二台计算机(源),并使用该计算机安装 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.
也许这不是最简单的,但 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.
也需要这方面的帮助,我太穷了,无法发表评论。
上述解决方案均无效。 RVM 离线文档根本没有帮助。无论我做什么,它都想从源代码安装,这没有帮助。
如何提示或强制 RVM 使用全局存档目录?
也许问题是:一旦 ruby 树就位,如何告诉 RVM 它在那里并且可以使用?
找到了答案。
按照 rvm 站点的建议,将二进制文件放入档案目录中,然后
挂载
它。:现在您可能会得到如下输出:
表明您正在在正确的轨道上。安装 yaml 后,我重做 rvm mount -r 操作并得到:
之后我验证:
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.:Now you might get output like this:
showing that you are on the right track. After installing yaml, I redo the
rvm mount -r
op and get:After which I verify:
rvm use 2.0.0-p598
And we're good to go.