Clone this wiki locally
You will need re2 installed first (by default, it will install into /usr/local though you can edit the Makefile to adjust this) so please follow the instructions on that link.
Once re2 is installed, you can install the gem with the following command:
gem install re2
Or if you installed re2 to a non-standard location such as /opt/local/re2:
gem install re2 -- --with-re2-dir=/opt/local/re2
Note that installing re2 in a non-standard location may cause issues dynamically linking to the library on Mac OS X; to work around this issue, you can set
DYLD_LIBRARY_PATH=/opt/local/re2 before executing your script or ensure that the library is already in a directory searched by dyld.