我有
group :production, :staging do
gem "therubyracer"
end
在我的Gemfile
中。如果我跑:
bundle install --without production staging test
therubyracer被添加到我的Gemfile.lock
。为什么会这样呢?我希望它被忽略?
为完整起见,如果我删除该行:
gem "therubyracer"
并运行上面的bundle命令,然后从Gemfile.lock
答案 0 :(得分:3)
我认为假设位于Gemfile.lock
,因为bundle
仍然需要计算并记录所有依赖关系等等。但是,运行bundle install --without <group>
实际上不会安装 gem - 您可以使用gem list -i therubyracer
进行检查(尽管如果您在没有{bundle install
的情况下运行它可能已经安装了--without ...
{1}})。