Git Product home page Git Product logo

Comments (7)

buffpojken avatar buffpojken commented on June 11, 2024 1

Thanks for pointers - I figured out what needed to happen and sorry for not recognising this as an environment issue and not an issue with the gem!

Cheers!

from rgeo.

keithdoggett avatar keithdoggett commented on June 11, 2024

Hi @buffpojken you're right it does seem like it should be installed properly.

Have you tried running

require 'rgeo'
require 'rgeo/geos/geos_c_impl'

In the environment yet? It should raise a LoadError and can perhaps give us some information about why it's not able to access the geo_c_impl.so file.

from rgeo.

buffpojken avatar buffpojken commented on June 11, 2024

Hi @keithdoggett - thanks for replying!
Trying to explicitly require that yields the following LoadError:

3.1.2 :005 > require 'rgeo'
 => false
3.1.2 :006 > require 'rgeo/geos/geos_c_impl'
<internal:/home/ec2-user/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require': libgeos_c.so.1: cannot open shared object file: No such file or directory - /home/ec2-user/.rvm/gems/ruby-3.1.2/gems/rgeo-2.4.0/lib/rgeo/geos/geos_c_impl.so (LoadError)
	from <internal:/home/ec2-user/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from (irb):6:in `<main>'
	from /home/ec2-user/.rvm/rubies/ruby-3.1.2/lib/ruby/gems/3.1.0/gems/irb-1.4.1/exe/irb:11:in `<top (required)>'
	from /home/ec2-user/.rvm/rubies/ruby-3.1.2/bin/irb:25:in `load'
	from /home/ec2-user/.rvm/rubies/ruby-3.1.2/bin/irb:25:in `<main>'
3.1.2 :007 >

but checking the explicit path mentioned clearly shows the file being present, executable and owned by the current user:

[ec2-user@ip-172-31-8-66 geos]$ pwd
/home/ec2-user/.rvm/gems/ruby-3.1.2/gems/rgeo-2.4.0/lib/rgeo/geos
[ec2-user@ip-172-31-8-66 geos]$ ls -lah
total 344K
drwxrwxr-x 2 ec2-user ec2-user  279 Dec  8 00:38 .
drwxrwxr-x 9 ec2-user ec2-user  283 Dec  8 00:38 ..
-rw-r--r-- 1 ec2-user ec2-user  15K Dec  8 00:38 capi_factory.rb
-rw-r--r-- 1 ec2-user ec2-user 4.0K Dec  8 00:38 capi_feature_classes.rb
-rw-r--r-- 1 ec2-user ec2-user  19K Dec  8 00:38 ffi_factory.rb
-rw-r--r-- 1 ec2-user ec2-user 1.6K Dec  8 00:38 ffi_feature_classes.rb
-rw-r--r-- 1 ec2-user ec2-user  15K Dec  8 00:38 ffi_feature_methods.rb
-rwxr-xr-x 1 ec2-user ec2-user 233K Dec  8 00:38 geos_c_impl.so
-rw-r--r-- 1 ec2-user ec2-user 9.6K Dec  8 00:38 interface.rb
-rw-r--r-- 1 ec2-user ec2-user 2.5K Dec  8 00:38 utils.rb
-rw-r--r-- 1 ec2-user ec2-user  13K Dec  8 00:38 zm_factory.rb
-rw-r--r-- 1 ec2-user ec2-user 1.5K Dec  8 00:38 zm_feature_classes.rb
-rw-r--r-- 1 ec2-user ec2-user 9.1K Dec  8 00:38 zm_feature_methods.rb
[ec2-user@ip-172-31-8-66 geos]$

Not sure if this tells you more than it tells me?

from rgeo.

keithdoggett avatar keithdoggett commented on June 11, 2024

Hey @buffpojken thanks for sending that info over.

From this line

<internal:/home/ec2-user/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require': libgeos_c.so.1: cannot open shared object file: No such file or directory - /home/ec2-user/.rvm/gems/ruby-3.1.2/gems/rgeo-2.4.0/lib/rgeo/geos/geos_c_impl.so (LoadError)

It looks like the issue is that the geos_c_impl library isn't able to dynamically load libgeos_c.so when it's being included (the error message mentions libgeos_c.so.1 not being found).

Can you try running

ldd /home/ec2-user/.rvm/gems/ruby-3.1.2/gems/rgeo-2.4.0/lib/rgeo/geos/geos_c_impl.so

It will output something like this

	linux-vdso.so.1 (0x00007fff3f9f9000)
	libruby.so.3.1 => /home/ec2-user/.rbenv/versions/3.1/lib/libruby.so.3.1 (0x00007fea6b882000)
	libgeos_c.so.1 => /lib/libgeos_c.so.1 (0x00007fea6b648000)
	libm.so.6 => /lib64/libm.so.6 (0x00007fea6b308000)
	libc.so.6 => /lib64/libc.so.6 (0x00007fea6af5b000)
	libz.so.1 => /lib64/libz.so.1 (0x00007fea6ad46000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fea6ab28000)
	librt.so.1 => /lib64/librt.so.1 (0x00007fea6a920000)
	libjemalloc.so.1 => /lib64/libjemalloc.so.1 (0x00007fea6a6ec000)
	libdl.so.2 => /lib64/libdl.so.2 (0x00007fea6a4e8000)
	libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007fea6a2b1000)
	/lib64/ld-linux-x86-64.so.2 (0x00007fea6c041000)
	libgeos-3.8.1.so => /lib/libgeos-3.8.1.so (0x00007fea69ee6000)
	libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007fea69b64000)
	libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fea6994e000)

but the libgeos_c line will probably have an invalid path or something.

from rgeo.

buffpojken avatar buffpojken commented on June 11, 2024

You are indeed correct - llibgeos_c is not found:

[ec2-user@ip-172-31-8-66 ~]$ ldd /home/ec2-user/.rvm/gems/ruby-3.1.2/gems/rgeo-2.4.0/lib/rgeo/geos/geos_c_impl.so
	linux-vdso.so.1 (0x00007ffcc1bfd000)
	libruby.so.3.1 => /home/ec2-user/.rvm/rubies/ruby-3.1.2/lib/libruby.so.3.1 (0x00007faf28c99000)
	libgeos_c.so.1 => not found
	libm.so.6 => /lib64/libm.so.6 (0x00007faf28959000)
	libc.so.6 => /lib64/libc.so.6 (0x00007faf285ac000)
	libz.so.1 => /lib64/libz.so.1 (0x00007faf28397000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007faf28179000)
	librt.so.1 => /lib64/librt.so.1 (0x00007faf27f71000)
	libdl.so.2 => /lib64/libdl.so.2 (0x00007faf27d6d000)
	libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007faf27b36000)
	/lib64/ld-linux-x86-64.so.2 (0x00007faf294c3000)
[ec2-user@ip-172-31-8-66 ~]$

I have no idea what that actually means though?

from rgeo.

keithdoggett avatar keithdoggett commented on June 11, 2024

You probably need to modify what paths your dynamic linker will search for. Since this is a dynamic library, it needs to find its dependent libraries at runtime and it doesn't use info from geos-config for that, but relies on ldconfig instead.

There's an easy way to test by modifying LD_LIBRARY_PATH and using ldconfig (https://unix.stackexchange.com/a/279398).

The answer below that one describes a potentially better long term solution that uses /etc/ld.so.conf.d as well. It might also be worth running ldconfig -v 2>/dev/null | grep -v ^$'\t' to see where the linker is currently looking for libraries.

from rgeo.

keithdoggett avatar keithdoggett commented on June 11, 2024

All good. Glad you got it working.

from rgeo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.