指定Gemfile的路径

问题描述 投票:0回答:1

我如何告诉捆绑程序不搜索 Gemfile 在当前目录下,但在其他地方?

我想做的是

bundle install --some-option path/to/Gemfile

而不是

cd path/to & bundle install
ruby bundler
1个回答
2
投票

您可以使用 --gemfile 选项。

--gemfile= Bundler 应该使用的 Gemfile(5) 的位置。默认值为当前工作目录中的 Gemfile(5) 。一般来说,Bundler 会假设 Gemfile(5) 的位置也是项目的根目录, 并会尝试在这个位置找到 Gemfile.lock 和 vendorcache。

来源:Bundler手册。Bundler手册

© www.soinside.com 2019 - 2024. All rights reserved.