我的Gemfile中的Bundler组没有被尊重

时间:2012-10-28 17:42:15

标签: ruby-on-rails-3 gem bundler

我有

group :production, :staging do
  gem "therubyracer"
end

在我的Gemfile中。如果我跑:

bundle install --without production staging test

therubyracer被添加到我的Gemfile.lock。为什么会这样呢?我希望它被忽略?

为完整起见,如果我删除该行:

  gem "therubyracer"

并运行上面的bundle命令,然后从Gemfile.lock

中移除therubyracer gem

1 个答案:

答案 0 :(得分:3)

我认为假设位于Gemfile.lock,因为bundle仍然需要计算并记录所有依赖关系等等。但是,运行bundle install --without <group>实际上不会安装 gem - 您可以使用gem list -i therubyracer进行检查(尽管如果您在没有{bundle install的情况下运行它可能已经安装了--without ... {1}})。