Recently started using RGeo a bit (I know, way late, but hey, it’s pretty awesome!), and ran into a production problem when using contains?

RGeo::Error::UnsupportedOperation: Method Geometry#contains? not defined.

RGeo depends on some kind of underlying geometry library, usually GEOS. In Ubuntu, the headers and source files for GEOS don’t get installed by default when you install geos, so the solution is to install them, as it is with so many of these issues:

sudo aptitude install geos-dev
bundle exec gem uninstall rgeo
bundle update rgeo

Update from April24, 2014

In Ubuntu 13.10 (saucy) package names are a bit different. Not sure if both of these are required, but the ++ one certainly is:

sudo aptitude install libgeos-dev
sudo aptitude install libgeos++-dev

Comments are closed.