Geos installation in non-standard location

一世执手 提交于 2019-12-23 02:54:38

问题


I'm running on nitrous.io and trying to install the rgeo gem using ruby 2.0.0-p353.

I don't have sudo access, so I tried to compile and install geos from source.

Once I downloaded and untarred the source files, I cd into the source folder and run

mkdir /home/action/local && ./configure --prefix=/home/action/local
make && make install

This runs for a bit. I then run

gem install rgeo -- --with-geos-dir=/home/action/local

Things look alright, but if I hop into a terminal I get

RGeo::Geos.supported?
> false

Looking back over the mkmf.log file, I see these lines:

/usr/bin/ld: cannot find -lgeos                                                                                                                                                    
/usr/bin/ld: cannot find -lgeos_c                                                                                                                                                  
/usr/bin/ld: cannot find -lgeos                                                                                                                                                    
/usr/bin/ld: cannot find -lgeos_c

This blog post: http://blog.thefrontiergroup.com.au/page/2/ mentions creating symbolic links to fix this issue:

cd /usr/lib
sudo ln -s libgeos-3.3.3.so libgeos.so
sudo ln -s libgeos-3.3.3.so libgeos.so.1

libgeos isn't installed to usr/lib for me, it's in /home/action/local/lib and when I check that directory I see libgeos.so is already symlinked to libgeos-x.x.x.so.

If I switch ruby versions to 1.9.3-p392 and run the gem installation line, everything works as planned.

On my MacBook Pro I can successfully use rgeo with ruby 2.0.0-p395, but the geos library is installed by homebrew and therefore in a path rgeo is expecting.

Was there a change with ruby 2.0 that affects compiling gems?

I'm using RVM on all machines

来源:https://stackoverflow.com/questions/21557845/geos-installation-in-non-standard-location

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!