捆绑包将选定的组安装到自定义路径中 [英] Bundle install selected group into custom path
问题描述
作为仅针对选定宝石的套件部署的后续操作,使用例如:
As a follow up to Bundle deployment only for selected gems, using the solution of blacklisting using --without
option, for example:
group :runtime do
gem 'rails'
...
end
group :runtime_unpackaged do
gem 'less2sass'
end
可以使用以下命令安装 runtime_unpackaged
:
The runtime_unpackaged
can be installed using the command:
bundle --path vendor/bundle --without runtime
$ b $ <
The runtime
group is installed through debian packages as the application itself is packaged as a .deb package.
但是, runtime
中的所有其他gem都不会被应用程序处理,因为此命令将创建一个文件 .bundle / config
将其过滤掉。
But then all other gems at group runtime
won't be handled anymore by the application as this command will create a file .bundle/config
that filters them out.
换句话说,我想加载应用程序使用来自系统的宝石--debian jessie包 - (group runtime
)以及本地安装在 vendor / bundle
(group runtime_unpackaged
)。
In other words, I want to load the application using gems from the system - debian jessie packages - (group runtime
) and also gems installed locally at vendor/bundle
(group runtime_unpackaged
).
推荐答案
如果你想运行Bundler和让它加载这两个组,你应该可以运行 bundle install
,并省略 - 而不用
标志。您还可以使用Bundler.require(:group1,:group2等)在application.rb文件中设置特定的组以使用 bundle install
运行。查看 Bundler.io 的小组部分
If you want to run Bundler and have it load both groups, you should just be able to run bundle install
and leave out the --without
flag. You can also set specific groups to get run with bundle install
in your application.rb file using Bundler.require(:group1, :group2, etc..). Check out Bundler.io's section on groups
这篇关于捆绑包将选定的组安装到自定义路径中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!