Check out example codes for "brew install ruby". It will help you in understanding the concepts better.
Code Example 1
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
Code Example 2
brew install ruby
Learn ReactJs, React Native from akashmittal.com