Using PassengerPane with GEM_HOME set

I use the excellent homebrew to manage my unix software on OS X, and as a result my bash profile includes export GEM_HOME /usr/local/Cellar/Gems/1.8. Unfortunately, that makes Passenger unable to find any of my gems, which is a bummer.

However, it turns out the fix is just a one-line change to the .vhost files that PassengerPane creates in /etc/apache2/passenger_pane_vhosts. Just add the line starting with SetEnv below, and restart Apache.