软件包安装 - 部署和捆绑软件包有什么区别? [英] Whats the difference between bundle install --deployment and bundle pack

查看:132
本文介绍了软件包安装 - 部署和捆绑软件包有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道他们都将宝石放在您的应用中的不同位置,但好像捆绑安装 - 部署做得更彻底。我可以添加它创建的供应商/捆绑软件目录到版本控制并完成吗?

这两个在Bundler的网站上。



运行 bundle install --deployment 将在生产环境中运行,但运行时将从rubygems中获取宝石。阅读更多此处的部署您的应用程序标题下的目的 - 部署标志。



捆绑软件包类似于Rails 2.3中的旧的 rake rails:gems:freeze 命令。它抓住宝石并将它们打包在供应商/缓存中。从捆绑商网站此处


您可以在部署时使用它避免rubygems.org上的依赖项
,或者如果
拥有不在
a中的私有gem公共存储库



I know they both put the gems in your app in different locations but it seems as if bundle install --deployment does a more thorough job. Can I just add the vendor/bundle directory it creates to version control and be done?

解决方案

Have a look at the description of the two on Bundler's site.

Running bundle install --deployment is to be run in the production environment, but will grab the gems from rubygems when run. Read more here under the 'Deploying Your Application' heading for the purpose of the --deployment flag.

bundle package is similar to the old rake rails:gems:freeze command from Rails 2.3. It grabs the gems and packages them in vendor/cache. From the bundler site here:

You can use this to avoid a dependency on rubygems.org at deploy time, or if you have private gems that are not in a public repository

这篇关于软件包安装 - 部署和捆绑软件包有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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