Bundler does not load the correct gemfile

I am installing a Ruby CI server that pulls Rails git repositories from Github and installs gems using the Bundler. The CI server has the Gemfile itself (as does the Rails application). So far so good.

Now I first start installing the package after a new git pull, this works fine:

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

Next, I list the installed gems and run the rake (to run the test suite):

bundle list
bundle exec rake

What is going to be there. These last 2 commands load the CI server's Gemfile, which is different from the one installed a few seconds ago. This Gemfile is in the parent directory that I want to run, so I assume that it first detects the β€œparent” Gemfile and forgets to look for the correct one.

Any idea how I can tell the supplier to use the right gems?

+3
source share
1 answer

Got it!

You can specify the Gemfile path as an environment variable:

export BUNDLE_GEMFILE=[..]/build_13/Gemfile

This will force the Bundler to use the correct gemfile. Thanks to an article by Philippe Creux for pointing me in the right direction.

For future reference:

I use BigTuna as my CI server, and you will need to add the instructions above for each step to make it work.

+3
source

Source: https://habr.com/ru/post/1796537/


All Articles