简体   繁体   English

捆绑包有什么意义?

[英]What is the point of bundle package?

I understand what Rail's bundle package does and how to use it, but I'm drawing a blank as to why it would be a useful command. 我理解Rail的bundle package作用以及如何使用它,但我在说明为什么它会是一个有用的命令。 What utility does it have? 它有什么用处?

bundle package will copy all the gems required by your application into the vendor/cache folder. bundle package会将应用程序所需的所有gem复制到vendor / cache文件夹中。 This also includes dependencies required by the gems. 这还包括gem所需的依赖项。

This helps because at the time of deployment you can just run bundle install --local to avoid dependency on the gems repository (rubygems.org) and install all the gems from the cached folder 这有帮助,因为在部署时您可以只运行bundle install --local以避免依赖gems存储库(rubygems.org)并从缓存的文件夹安装所有gem

Because each gem might have different dependencies depending upon the platform in which it is installed, it's recommended to use bundle package only when your development and deployment environments are alike. 由于每个gem可能具有不同的依赖关系,具体取决于安装它的平台,因此建议仅在开发和部署环境相同时才使用bundle package

You would use it when you have a need to not connect to the gem source, its useful if your moving files across machines and don't want to fetch gems from a remote source all the time. 当您需要不连接到gem源时,可以使用它,如果您跨机器移动文件并且不想一直从远程源获取gem,则它非常有用。 See the documentation here . 请参阅此处的文档。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM