You must use Bundler 2 or greater with this lockfile

Bitrise Build Issue Report template

Description of the issue

I need Bundler 2+ but Bitrise has 1.x only.
If I do nothing I get

Install Fastlane with bundler
$ bundle "install" "--jobs" "20" "--retry" "5"
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and
installing your bundle as root will break this application for all non-root
users on this machine.
You must use Bundler 2 or greater with this lockfile.
Command failed, error: exit status 20

If I try to update Bundler using a script I get:

+ gem install bundler
ERROR:  Error installing bundler:
	"bundle" from bundler conflicts with /usr/local/bin/bundle

Environment:

Bitrise - Android & Docker, on Ubuntu 16.04

Any help ? In the meantime I will rollback to earlier version of bundler but help would be appreciated.

thank you
nicolas

2 Likes

Hello there!

Could you provide the url of this build so we can check the logs for more details?

also, are you running a fastlane step or you run this from a script step? in fastlane step if you set Should update fastlane gem before run to true, this should be no problem.

@fehersanyi-bitrise I’m facing similar issue. With an iOS build, but the root of the problem is the same: Unable to update the bundler to 2.0 to use it with a Gemfile.lock bundled using 2.0.1.

Hello,

I had the same problem on Xcode 10.1.x, on macOS 10.13. In my case, we had a Makefile with bundle exec fastlane scan. This failed because the system-installed bundler had invalid (or lack of) concurrent-ruby gem.

Tried installing Ruby 2.6.0 into a rbenv but this was like going into a rabbit hole of dep. issues so I forgo this.

I solved it by running the Fastlane step with scan command directly, without bundler and it worked. Maybe this works in your case as well.

Hy @FWIgor and @rszalski

the workaround that seems to be working right now is to uninstall and reinstall bundle as it is.

@fehersanyi-bitrise How can I uninstall the bundler? A “simple” approach of running gem uninstall bundler do not work, and give me the error:

Uninstalling bundler
Gem 'bundler' is not installed

Installing bundler, version 2.0.1
ERROR: Error installing bundler:
"bundle" from bundler conflicts with /usr/local/bin/bundle

Hy there! @FWIgor sorry for the late response!

the solution is “May the --force be with you!”

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

Hi,
There is a new version of fastlane-install available (2.5.1):

Bundler is installed before executing bundle install, in case a Gemfile.lock is present. The specific version defined in the Gemfile.lock under BUNDLED WITH is installed and used to run the bundle install command.
The issues fixed include the error messages printed during build: rbenv: bundle: command not found
and You must use Bundler 2 or greater with this lockfile.

The fix is also available in:
cocoapods-install (Release 1.8.0 · bitrise-steplib/steps-cocoapods-install · GitHub)
deploy-to-itunesconnect-deliver (Release 2.16.0 · bitrise-steplib/steps-deploy-to-itunesconnect-deliver · GitHub)