bundle install --deployment 和 bundle pack 有什么区别 [英] Whats the difference between bundle install --deployment and bundle pack

查看:44
本文介绍了bundle install --deployment 和 bundle pack 有什么区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道他们都将您的应用中的 gem 放在不同的位置,但似乎 bundle install --deployment 做得更彻底.我可以将它创建的 vendor/bundle 目录添加到版本控制中并完成吗?

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?

推荐答案

在 Bundler 的网站上查看两者的描述.

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

Running bundle install --deployment 将在生产环境中运行,但在运行时会从 ruby​​gems 中获取 gem.阅读此处的部署您的应用程序"标题下的更多信息--deployment 标志.

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 类似于 Rails 2.3 中旧的 rake rails:gems:freeze 命令.它抓取宝石并将它们打包在供应商/缓存中.从打包站点这里:

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:

您可以使用它来避免依赖在部署时在 ruby​​gems.org 上,或者如果你有私人宝石不在一个公共仓库

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

这篇关于bundle install --deployment 和 bundle pack 有什么区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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