Xcode 10.1.0 image change?

Our deploy_ios CircleCI job started running into issues on Friday even though we haven’t made any recent changes to our deployment code. This is the step in our job that is failing:

      - run:
          name: Install fastlane
          working_directory: ~/twobird/ios
          command: |
            echo "ruby-2.4" > ~/.ruby-version # Set Ruby version
            gem install bundler --user-install
            bundle install

It started failing with this error:

Fetching: bundler-2.0.2.gem (100%)
WARNING:  You don't have /Users/distiller/.gem/ruby/2.4.0/bin in your PATH,
	  gem executables will not run.
Successfully installed bundler-2.0.2
1 gem installed
You must use Bundler 2 or greater with this lockfile.
Exited with code 20

Our Gemfile.lock was bundled with bundler 2.0.1 and we’re installing bundler 2.0.2, so there shouldn’t be a problem with the bundler version. Our last successful build was installing the same bundler version.

I tried modifying the build step to use the Bundler version we specify in our Gemfile.lock, but that doesn’t work either. This is what I tried:

            gem update --system
            export BUNDLER_VERSION=$(cat Gemfile.lock | tail -1 | tr -d " ")
            gem install bundler --user-install -v $BUNDLER_VERSION
            bundle _${BUNDLER_VERSION}_ install

and the error I get:

Successfully installed bundler-2.0.1
Parsing documentation for bundler-2.0.1
Installing ri documentation for bundler-2.0.1
Done installing documentation for bundler after 7 seconds
1 gem installed
/Users/distiller/.rubies/ruby-2.4.5/lib/ruby/site_ruby/2.4.0/rubygems.rb:284:in `find_spec_for_exe': Could not find 'bundler' (2.0.1) required by `$BUNDLER_VERSION`. (Gem::GemNotFoundException)
To update to the latest version installed on your system, run `bundle update --bundler`.
To install the missing version, run `gem install bundler:2.0.1`
	from /Users/distiller/.rubies/ruby-2.4.5/lib/ruby/site_ruby/2.4.0/rubygems.rb:303:in `activate_bin_path'
	from /Users/distiller/.gem/ruby/2.4.5/bin/bundle:23:in `<main>'
Exited with code 1

How can I fix this?

Hi Chris,

We’ve changed the default shell to be a login shell on macOS to work around some Ruby issues with Xcode 11. This has caused some other problems like this, sorry about that.

My hunch is that your call to

echo "ruby-2.4" > ~/.ruby-version # Set Ruby version

had no effect prior to our change on Friday, and it is having an effect now, but only on the build steps after it, not on the step it’s done in.

Are you specify a shell for your job? Im guessing that you are not, and you can revert to the old behavior by adding

shell: bash -eo pipefail

To your job declaration.


Thanks, that fixes the issue.

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