Issues while setting up a KMM project

Hey guys I was following the official Documentation to setup environment for developing a KMM project but I have ran into the following problem:
While running

https://preview.redd.it/9qfl2v5ijtsa1.png?width=1550&format=png&auto=webp&s=5d41e04f3491b11d014c92cc8a8d334a1dce28e7

As I'm following the StackOverflow link mentioned in the above image

https://preview.redd.it/rxioq91njtsa1.png?width=1818&format=png&auto=webp&s=a39c47e4bde36fe4246f0b4fe3660b4b7174682e

Before adding the path to my .zshrc file, executing which ruby returned /usr/bin/ruby and (brew --prefix) returned /usr/local after that I followed the second step.
This is the path I added to my .zshrc file

https://preview.redd.it/7ka4dmkpjtsa1.png?width=1200&format=png&auto=webp&s=9d4626c6058806c51b36146431ff6d93a9029019

but as I'm running which ruby in my terminal again it's still showing /usr/bin/ruby but according to the solution it should be (brew --prefix)/opt/ruby/bin/ruby
I have made sure that my .zshrc file is getting updated.

I guess this is the reason of the failure but I may be wrong any tips on resolving this? Thanks