These are the steps that solved it for me:
- Install rvm using
curl -sSL https://raw.githubusercontent.com/rvm/rvm/master/binscripts/rvm-installer | bash -s stable
- Reload terminal
- Upgrade xcode to latest version
rvm install ruby-2.7
rvm use ruby-2.7.5
- Fastlane should work as expected
Below I noted detailed error messages and solutions:
We use Fastlane to help Android build on our React Native project. After upgrading my macOS to Monterey 12.1, my
bundle exec fastlane commands no longer work, and I was prompted to update my bundler. But when I ran
bundle update, I got this error:
An error occurred while installing unf_ext (0.0.7.7), and Bundler cannot continue. Make sure that `gem install unf_ext -v '0.0.7.7' --source 'https://rubygems.org/'` succeeds before bundling.
However, running the suggested command didn't work. After digging around, I found that I needed to upgrade my ruby version to v2.7, for which I ended up using rvm. Note that after installing rvm, the
rvm commands won't be available until the terminal has been restarted.
Then, when I first used
rvm install ruby-2.7, it wasn't successful due to this error
Error running '__rvm_make -j16'. After checking the 'make.log' file, I found this error,
use of undeclared identifier RUBY_FUNCTION_NAME_STRING. Updating my xcode to the latest version ended up getting rid of the error.
Finally, I was able to use ruby v2.7.5 with
rvm use ruby-2.7.5. (You can check that your ruby version is successfully updated using
ruby -v). And
bundle update ran successfully and my Fastlane commands started working as expected.
Hopefully this post can be of help to people who're searching for solutions to make Fastlane work with macOS Monterey!
Top comments (0)