# heroku-apps-with-gem.sh
apps=$(heroku apps | grep -E -v '(^===|^$)' | awk '{print $1}')
set -k
for app in $apps; do
heroku run "cat Gemfile.lock | grep $1" -a $app --exit-code > /dev/null 2>&1
if (( $? == 0)); then
echo $app
fi
done
$ ./heroku-apps-with-gem.sh rails
This is now https://github.com/hyperoslo/heroku-apps-with-gem