How to install the bootsnap gem?

I tried installing it on a fresh Ubuntu 17.04, but it fails with the same error.

https://github.com/Shopify/bootsnap/issues/15