3

We were using fastlane to run the CI work. Had to use AdService framework, and for that had to update Xcode. In order to do that, had to update macOS to Big Sur. After updating everything, gitlab CI stopped working:

$ bundle exec fastlane build
bundler: failed to load command: fastlane (/usr/local/bin/fastlane)
Bundler::GemNotFound: Could not find rake-13.0.3 in any of the sources
  /Users/ci/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bundler-1.17.2/lib/bundler/spec_set.rb:91:in `block in materialize'
  /Users/ci/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bundler-1.17.2/lib/bundler/spec_set.rb:85:in `map!'
  /Users/ci/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bundler-1.17.2/lib/bundler/spec_set.rb:85:in `materialize'
  /Users/ci/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bundler-1.17.2/lib/bundler/definition.rb:170:in `specs'
  /Users/ci/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bundler-1.17.2/lib/bundler/definition.rb:237:in `specs_for'
  /Users/ci/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bundler-1.17.2/lib/bundler/definition.rb:226:in `requested_specs'
  /Users/ci/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bundler-1.17.2/lib/bundler/runtime.rb:108:in `block in definition_method'
  /Users/ci/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bundler-1.17.2/lib/bundler/runtime.rb:20:in `setup'
  /Users/ci/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bundler-1.17.2/lib/bundler.rb:107:in `setup'
  /Users/ci/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bundler-1.17.2/lib/bundler/setup.rb:20:in `<top (required)>'
  /Users/ci/.rbenv/versions/2.7.2/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'
  /Users/ci/.rbenv/versions/2.7.2/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'

So what I already tried: in .bash_profile added:

export PATH="$HOME/.fastlane/bin:$PATH"

It did not helped. Tried :

sudo gem install fastlane -NV

That did not help either.

Also tried:

fastlane update_fastlane

And:

bundle install --path vendor/cache

Was trying to google for the solution, but unluckly can't fix that. I am an iOS dev, so this is something new to me.

Any ideas how this could be fixed?

Holger Just
  • 52,918
  • 14
  • 115
  • 123
Jkrist
  • 748
  • 1
  • 6
  • 24
  • Can you try this? `fastlane update_fastlane` – Akif Aug 11 '21 at 06:58
  • Possible duplicate of https://stackoverflow.com/a/26231894/10659482 – Akif Aug 11 '21 at 07:03
  • @Akif ah yes, forgot to mention, tried with fastlane update_fastlane, also fastlane run update_fastlane, and also with bundle install --path vendor/cache did not helped either :/ – Jkrist Aug 11 '21 at 07:06
  • Ok, what about this? `gem install rake && bundle install` – Akif Aug 11 '21 at 07:10
  • @Akif okey, that was something new I tried, but still no luck... Still same error, and fastlane command can't be found. When I look for fastlane with `where fastlane` I get /usr/local/bin/fastlane – Jkrist Aug 11 '21 at 07:18
  • Can you go here: `/usr/local/bin/fastlane`and right-click on `fastlane`, and `show original`. Later, right-click that `fastlane`, and `Get Info`. Share the location of that file with us. I'm trying to learn the version of your fastlane. You may delete `/usr/local/Cellar/fastlane`, and reinstall fastlane. – Akif Aug 11 '21 at 07:28
  • @Akif ghm, when right clicking on fastlane, I don't see an option to `show original` what could be the reason for that? – Jkrist Aug 11 '21 at 08:57
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/235872/discussion-between-jkrist-and-akif). – Jkrist Aug 11 '21 at 09:23

1 Answers1

2

Okey, so for the ones who are looking for a solution, after 2 days I finally found an issue. Was digging a lot, changing, installing, reinstalling etc. I thought of trying everything.

In my case, I use bash shell, so configured .bash_profile, added these lines of code:

export PATH="$HOME/.fastlane/bin:$PATH"
if [ -f ~/.bashrc ]; then
   source ~/.bashrc
fi

in .bashrcthere was some paths, that I commented out, and now there is only 1 line of code:

eval "$(rbenv init -)"

After doing that all works P.S. if you are using zsh then files are different. Not 100% sure, but check .profile, .zshrc

Also I have edited gemfile.lock, as some gems were not as required, but not even sure if that was needed, as now I am not going to touch CI as it works :D

Hope that will save some time for someone in future. Else, if someone wants to add something, you are more then welcome (with some explanation would be even better, as not many of developers probably knows how all this crazy stuff works :) )

Jkrist
  • 748
  • 1
  • 6
  • 24