Install old versions therubyracer gem on Mac OS X

I had a problem when I tried to install version 0.10.2 of therubyracer gem on Mac OS X Yosemite, so I searched and I tried different solutions, and the one it works for me was this:

brew tap homebrew/dupes  
brew install apple-gcc42

export CC=/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/gcc-4.2  
export CXX=/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/g++-4.2  
export CPP=/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/cpp-4.2

brew uninstall v8

gem uninstall libv8

gem install therubyracer -v '0.10.2'  

Any place where I can pick the code of this tip?

Yeah! Here you have the Github gist for this tip :)