Installing gems with native extensions on TravisCI

I was mucking around with TravisCI recently. And when I was setting up a Rails project with travis. I hit a wall trying to get a ruby gem ( with a native extention ( to get to install on travis.

Thanks to GeoIP2-python ('s travis.yml I figured out how to solve the issue.

It's pretty straight forward really. Travis builds your project on a Ubuntu machine on cloud. So you'd install anything on it just as you would on a Ubuntu box.

As for the library above, you can add the build steps in before_install (in your travis.yml).

  - git submodule update --init --recursive
  - git clone --recursive git://
  - cd libmaxminddb
  - ./bootstrap
  - ./configure
  - make
  - sudo make install
  - sudo ldconfig
  - cd ..

It's important not to omit the last command (cd ..). If not all your other build steps would run inside the libmaxminddb folder (remmber cd libmaxminddb).