`gitlab-gitaly`: "Could not find 'bundler'" when using bundler 2.1.4
So when I try to emerge gitlab-gitaly
when bundler-2.1.4
is installed, I get the following error:
>>> Unpacking source...
* Repository id: gitlab-org_gitaly.git
* Fetching https://gitlab.com/gitlab-org/gitaly.git ...
git fetch https://gitlab.com/gitlab-org/gitaly.git +refs/tags/v1.87.0:refs/tags/v1.87.0
git symbolic-ref refs/git-r3/dev-vcs/gitlab-gitaly/0/__main__ refs/tags/v1.87.0
* Checking out https://gitlab.com/gitlab-org/gitaly.git to /var/tmp/portage/dev-vcs/gitlab-gitaly-1.87.0/work/gitlab-gitaly-1.87.0 ...
git checkout --quiet refs/tags/v1.87.0
GIT update -->
repository: https://gitlab.com/gitlab-org/gitaly.git
at the commit: d9d892a8315116042c24bdf6763a6d0b9c09ba0a
>>> Source unpacked in /var/tmp/portage/dev-vcs/gitlab-gitaly-1.87.0/work
>>> Preparing source in /var/tmp/portage/dev-vcs/gitlab-gitaly-1.87.0/work/gitlab-gitaly-1.87.0 ...
/var/tmp/portage/dev-vcs/gitlab-gitaly-1.87.0/work/gitlab-gitaly-1.87.0/ruby /var/tmp/portage/dev-vcs/gitlab-gitaly-1.87.0/work/gitlab-gitaly-1.87.0
Traceback (most recent call last):
3: from /usr/local/bin/bundle:22:in `<main>'
2: from /usr/lib64/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_gem.rb:62:in `gem'
1: from /usr/lib64/ruby/site_ruby/2.5.0/rubygems/dependency.rb:323:in `to_spec'
/usr/lib64/ruby/site_ruby/2.5.0/rubygems/dependency.rb:313:in `to_specs': Could not find 'bundler' (1.17.3) required by your /var/tmp/portage/dev-vcs/gitlab-gitaly-1.87.0/work/gitlab-gitaly-1.87.0/ruby/Gemfile.lock. (Gem::MissingSpecVersionError)
To update to the latest version installed on your system, run `bundle update --bundler`.
To install the missing version, run `gem install bundler:1.17.3`
Checked in 'GEM_PATH=/var/tmp/portage/dev-vcs/gitlab-gitaly-1.87.0/homedir/.gem/ruby/2.5.0:/usr/lib64/ruby/gems/2.5.0:/usr/local/lib64/ruby/gems/2.5.0', execute `gem env` for more information
/var/tmp/portage/dev-vcs/gitlab-gitaly-1.87.0/work/gitlab-gitaly-1.87.0
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/dev-vcs/gitlab-gitaly-1.87.0/work/gitlab-gitaly-1.87.0 ...
>>> Source configured.
>>> Compiling source in /var/tmp/portage/dev-vcs/gitlab-gitaly-1.87.0/work/gitlab-gitaly-1.87.0 ...
make -j1 -l1
mkdir -p _build/src/gitlab.com/gitlab-org
cd _build/src/gitlab.com/gitlab-org && rm -f gitaly && \
ln -sf ../../../.. gitaly
touch _build/.ok
(cd _build && go mod init _build)
go: creating new go.mod: module _build
cd _build && go build -o /var/tmp/portage/dev-vcs/gitlab-gitaly-1.87.0/work/gitlab-gitaly-1.87.0/_build/makegen /var/tmp/portage/dev-vcs/gitlab-gitaly-1.87.0/work/gitlab-gitaly-1.87.0/_support/makegen.go
cd _build && ./makegen > Makefile
cd _build && make install INSTALL_DEST_DIR=/var/tmp/portage/dev-vcs/gitlab-gitaly-1.87.0/work/gitlab-gitaly-1.87.0
make[1]: Entering directory '/var/tmp/portage/dev-vcs/gitlab-gitaly-1.87.0/work/gitlab-gitaly-1.87.0/_build'
cd /var/tmp/portage/dev-vcs/gitlab-gitaly-1.87.0/work/gitlab-gitaly-1.87.0/ruby && bundle config # for debugging
Traceback (most recent call last):
3: from /usr/local/bin/bundle:22:in `<main>'
2: from /usr/lib64/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_gem.rb:62:in `gem'
1: from /usr/lib64/ruby/site_ruby/2.5.0/rubygems/dependency.rb:323:in `to_spec'
/usr/lib64/ruby/site_ruby/2.5.0/rubygems/dependency.rb:313:in `to_specs': Could not find 'bundler' (1.17.3) required by your /var/tmp/portage/dev-vcs/gitlab-gitaly-1.87.0/work/gitlab-gitaly-1.87.0/ruby/Gemfile.lock. (Gem::MissingSpecVersionError)
To update to the latest version installed on your system, run `bundle update --bundler`.
To install the missing version, run `gem install bundler:1.17.3`
Checked in 'GEM_PATH=/var/tmp/portage/dev-vcs/gitlab-gitaly-1.87.0/homedir/.gem/ruby/2.5.0:/usr/lib64/ruby/gems/2.5.0:/usr/local/lib64/ruby/gems/2.5.0', execute `gem env` for more information
make[1]: *** [Makefile:59: ../.ruby-bundle] Error 1
make[1]: Leaving directory '/var/tmp/portage/dev-vcs/gitlab-gitaly-1.87.0/work/gitlab-gitaly-1.87.0/_build'
make: *** [Makefile:33: build] Error 2
Oddly, when I install bundler-1.17.3-r1
, I can emerge gitlab-gitaly
with no issues.
Manually running bundle
in /var/tmp/portage/dev-vcs/gitlab-gitaly-1.87.0/work/gitlab-gitaly-1.87.0/ruby
works fine even if I only have bundler-2.1.4
installed. So somehow portage is changing the ruby environment maybe?