Bash script to install Gems
I looked all over and couldn’t find a bash script which could check and if missing install a list of gems. I had to hack my own up:
GEMS=( `cat gems.txt` ) # gems.txt has one gem name per line
for gem in "${GEMS[@]}"; do
found=`gem list $gem | grep -i $gem`
if [ "$found" != "" ]; then
parts=( $found )
echo "Found ${parts[0]} ${parts[1]}"
continue
fi
echo "---------------------------"
echo "Installing $gem"
sudo gem install $gem -y
echo "---------------------------"
done
No comments yet, be the first one!
Leave a Reply