gpt4 book ai didi

gem - Bundler 没有加载正确的 Gemfile

转载 作者:行者123 更新时间:2023-12-01 01:30:24 25 4
gpt4 key购买 nike

我正在安装一个 Ruby CI 服务器,它从 Github 中提取我的 Rails git repos 并使用 Bundler 安装 gem。 CI 服务器有一个自己的 Gemfile(因为它也是一个 Rails 应用程序)。到现在为止还挺好。

现在,我在新的 git pull 之后首先运行 bundle install,这很好用:

bundle install --gemfile=[..]/build_13/Gemfile --deployment

接下来我列出已安装的 gems 并运行 rake(运行测试套件):
bundle list
bundle exec rake

这就是它要去的地方。最后 2 个命令加载 CI 服务器的 Gemfile,这与几秒钟前安装的不同。这个 Gemfile 位于我要运行的那个的父目录中,所以我想它首先找到了“父”Gemfile 并忘记寻找正确的 Gemfile。

知道如何告诉 bundle 程序使用正确的 gem 吗?

最佳答案

知道了!

您可以将 Gemfile 路径指定为环境变量:

export BUNDLE_GEMFILE=[..]/build_13/Gemfile

这将强制 Bundler 使用正确的 Gemfile。感谢 Philippe Creux' article为我指明了正确的方向。

备查:

我正在使用 BigTuna作为我的 CI 服务器,您需要为每个“步骤”添加上面的语句以使其工作。

关于gem - Bundler 没有加载正确的 Gemfile,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5206456/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com