为什么'捆绑'在我的开发机器上安装生产宝石? [英] Why does 'bundle' install production gems on my development machine?

查看:79
本文介绍了为什么'捆绑'在我的开发机器上安装生产宝石?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Gemfile说:

  gem'sqlite3',:groups => [:development,:test] 
gem'mysql2',:group => :生产

但是当我键入 bundle install 在我的开发机器上安装了所有宝石。



我的设置出了什么问题?

解决方案 Bundler的重点在于跨部署创建一致的gem环境。不幸的是,宝石即使没有加载或不需要也可以进行交互。所以为了获得最大的一致性,所有的宝石都应该安装,即使它们不是全部都是必需的。



然而,如果你不希望所有的宝石都安装好,您可以使用 bundle install --without 选项。


Gemfile says:

gem 'sqlite3', :groups => [:development, :test]
gem 'mysql2', :group => :production

yet when I type bundle install on my development machine ALL gems are installed.

What's wrong with my setup?

解决方案

The point of Bundler is to create a consistent gem environment across deployments. Gems, unfortunately, can interact even if they aren't loaded or required. So for maximum consistency, all gems should be installed, even if they aren't all required.

However, if you don't want all gems installed all the time, you can use the bundle install --without option.

这篇关于为什么'捆绑'在我的开发机器上安装生产宝石?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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