Skip to content

Instantly share code, notes, and snippets.

@85636682
Created December 16, 2015 09:07
Show Gist options
  • Save 85636682/b03cf99ab51a85fb97c7 to your computer and use it in GitHub Desktop.
Save 85636682/b03cf99ab51a85fb97c7 to your computer and use it in GitHub Desktop.
安装geos
Just got it working after 2 hours of tinkering.
For Ubuntu 14.04, libgeos 3.4.2, and RGeo 0.3.20 in Rails 4.2.1:
sudo apt-get -y install libgeos-3.4.2 libgeos-dev libproj0 libproj-dev
sudo ln -s /usr/lib/libgeos-3.4.2.so /usr/lib/libgeos.so
sudo ln -s /usr/lib/libgeos-3.4.2.so /usr/lib/libgeos.so.1
In the Gemfile:
gem 'rgeo', require: false
Good luck!
#remove previous rgeo installation
gem uninstall rgeo
#install GEOS packages
sudo apt-get install libgeos-dev
sudo apt-get install libgeos-3.3.8
#install proj package, I don't need it actually but not sure if it wasn't working because of this
sudo apt-get install proj
#Create a symbolic link named libgeos.so that points to the newly installed version of libgeos
cd /usr/lib
ln -s libgeos-3.3.8.so libgeos.so
#clone the repo of the rails project in other location, Rails apparently insisted on using the old, unlinked to GEOS, version of the gem
#And the reinstall the project's gems
bundle install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment