捆绑安装 --deployment 和捆绑包之间有什么区别
我知道他们都将 gem 放在您的应用程序中的不同位置,但似乎 bundle install --deployment 做得更彻底。我可以将它创建的供应商/捆绑目录添加到版本控制中并完成吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我在开发模式下使用
bundle install --pathvendor/bundle
。bundle install --deployment
将锁定您的 Gemfile.lock,并且当您更改 Gemfile 时不会更新它,因此切勿在开发环境中使用部署选项。bundle install --no-deployment
将禁用捆绑包部署模式。您可以阅读这篇关于正确使用捆绑包的帖子。
I use
bundle install --path vendor/bundle
in development mode.bundle install --deployment
will lock yor Gemfile.lock and will not update it when you change your Gemfile, so never use deployment option on development environment.bundle install --no-deployment
will disable bundle deployment mode.You can read that post about bundle usage in right way.
查看 Bundler 网站上对两者的描述。
运行
bundle install --deployment
将在生产环境中运行,但运行时会从 rubygems 中获取 gem。请在此处阅读“部署您的应用程序”标题下的更多信息,以便--deployment
标志。bundle package
类似于 Rails 2.3 中旧的rakerails:gems:freeze
命令。它获取 gems 并将它们打包到供应商/缓存中。从捆绑器网站此处: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 oldrake rails:gems:freeze
command from Rails 2.3. It grabs the gems and packages them in vendor/cache. From the bundler site here:我在 RailsConf 2011 上的一次演讲中用相当长的篇幅解释了 --deployment 模式标志背后的推理。这篇博文包含我对该演讲的笔记,并且(我希望)涵盖了 --deployment 方式背后的所有推理作品:<一href="http://andre.arko.net/2011/06/11/deploying-with-bundler-notes/">http://andre.arko.net/2011/06/11/deploying-with-bundler -注释/
I explained the reasoning behind the --deployment mode flag at pretty great length in a talk I gave at RailsConf 2011. This blog post contains my notes for that talk, and (I hope) covers all of the reasoning behind the way --deployment works: http://andre.arko.net/2011/06/11/deploying-with-bundler-notes/