Ruby gem 对离线服务器的依赖 [英] Ruby gem dependencies on offline server
问题描述
我的服务器与 Internet 完全断开(出于某些奇怪的安全原因).
I have a server that is totally disconnected from the Internet (for some strange security reasons).
如何使各种 gem 的 Ruby 依赖项在该环境中工作?它可能适用于 Bundler,但如何在没有 Internet 连接的情况下使用 gem 安装 Bundler?
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?
推荐答案
您可以从 rubygems 下载 bundler 作为 .gem
文件,然后使用
You can download bundler as a .gem
file from rubygems and install it on the server with
gem install /path/to/bundler.gem
然后您可以将应用程序所需的所有 gem 打包到 ./vendor/cache
目录中
Then you can pack all gems required for your application into ./vendor/cache
directory with
bundle package
如果现在您将应用程序(连同 ./vendor/cache
目录)部署到服务器并运行
If now you deploy your app (along with ./vendor/cache
directory) to the server and run
bundle install --local
bundler 不会转到 rubygems,而是会从 ./vendor/cache
目录安装所有 gem.
bundler won't go to rubygems, but instead will install all gems from ./vendor/cache
directory.
参见 bundler-package
文档 了解更多信息.
See bundler-package
docs for more information.
这篇关于Ruby gem 对离线服务器的依赖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!