Check if a #ruby gem is installed from bash script
If you are adding customizations to your zshrc, such as adding auto completion for a certain gem, you want to make sure that the gem is installed before performing any action.
The gem list [gemname] -i
command returns a boolean representing whether a gem is installed or not.
If you wish to be more granular you can check whether a specific version is installed by adding the --version [version]
flag.