离线服务器上的Ruby gem依赖关系 [英] Ruby gem dependencies on offline server

查看:98
本文介绍了离线服务器上的Ruby gem依赖关系的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一台与Internet完全断开连接的服务器(出于一些奇怪的安全原因)。



如何使Ruby依赖项适用于各种gem环境?它可能适用于 Bundler ,但是如何在没有Internet连接的情况下使用 gem 安装Bundler?方案

您可以从rubygems下载捆绑软件作为 .gem 文件,并使用

将其安装在服务器上

  gem install /path/to/bundler.gem 

然后你可以用

./ vendor / cache 目录> 捆绑软件包

如果您现在部署您的应用程序(< ($ c> ./ vendor / cache directory)到服务器并运行

  bundle install  - 本地

bundler不会去rubygems,而是会从 ./ vendor / cache 目录。



请参阅 bundler-package docs 了解更多信息。

I have a server that is totally disconnected from the Internet (for some strange security reasons).

How can I make the Ruby dependencies to various gems work in that environment? It might work with Bundler, but how do I install Bundler using gem without a Internet connection?

解决方案

You can download bundler as a .gem file from rubygems and install it on the server with

gem install /path/to/bundler.gem

Then you can pack all gems required for your application into ./vendor/cache directory with

bundle package

If now you deploy your app (along with ./vendor/cache directory) to the server and run

bundle install --local

bundler won't go to rubygems, but instead will install all gems from ./vendor/cache directory.

See bundler-package docs for more information.

这篇关于离线服务器上的Ruby gem依赖关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆