Ruby gem dependencies on offline server

爱⌒轻易说出口 提交于 2019-11-27 03:17:21

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/11291235/ruby-gem-dependencies-on-offline-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!