Member-only story
Overriding built in ruby for MacOS Sonoma
As a Flutter developer, I’ve found that using the built-in Ruby in macOS can be challenging. This issue surfaced when I tried to use the flutter_osm_plugin
that requires the Alamofire library.
The error was overwhelming and took me a few days to find the correct solution. So, I decided to give Homebrew a shot to install Ruby and then install CocoaPods. If you guys have the same problem as me, I think this would be useful to save you lots of time finding the right solution.
Let’s get started!
In this tutorial, we will do the following:
- Install Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo "eval $(/opt/homebrew/bin/brew shellenv)" >> ~/.zprofile
eval $(/opt/homebrew/bin/brew shellenv)
After installing the homebrew, you can test it by running this command brew — version
in your terminal. if its correctly installed, the output should be as follows.
2. Install chruby and ruby-install
brew install chruby ruby-install
3. Install ruby using the ruby-install
ruby-install ruby