check if gem exists code example
Example 1: how do i know if a gem is installed
# answer will be true or false
gem list -i <gem_name>
# Add the version option
gem list -i <gem_name> -v version
Example 2: bash check in gem is installed
if `gem list lunchy -i`; then
echo "Lunchy gem is installed!";
# do some configuration here
fi