-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RGeo::Geos.supported? false with GEOS 3.12 on Amazon Linux 2023 #365
Comments
Downgraded to GEOS 3.7 installed directly from EPEL 8 RPM and now I get this error:
Does it seem more like issue with Ruby 3.2 or too new GEOS (3.12) ? I mean, GEOS 3.12 works perfectly fine with rgeo 3.0 on my Macbook at least. |
Have you tried running |
I tried, What's more, when I look in GEM_HOME, I can see these files in
|
Hi @januszm, given your comment (#360 (comment)) in another issue it seems like you were able to get this compiled or are you still having issues? |
@keithdoggett unfortunately it's still an issue, I decided to continue with I'm going to give it one more try on a fresh Amazon Linux 2023 server outside the usual Elastic Beanstalk Ruby 3.2 platform and see if it works there. |
Ok let me know how that goes. Next week I might have some time to test it as well. I also had a ton of issues migrating to Amazon Linux 2023 and ended up containerizing as much as I could since it seemed like every dependency was broken. |
It works on a regular EC2 server running Amazon Linux 2023 with Ruby 3.2.2
In this case we can close this issue because this is something related only to one specific Amazon product, Elastic Beanstalk where Ruby setup looks to be slightly different. FYI my approach to AL2023 is, I compile missing dependencies, such as FreeTDS or GEOS from source and package as tar.gz archives stored on S3. When I need them for Ruby gems I simply call:
before |
@keithdoggett something is not right here still, see, if I just test RGeo Geos support from Rails console it says bin/rails console
> RGeo::Geos.supported?
=> false
bundle exec irb
> require "rgeo"
=> true
> RGeo::Geos.supported?
=> false but If I test it from IRB, with a slightly different order of initializating RGeo modules: > require "rgeo/feature"
=> true
> require 'rgeo/impl_helper'
=> true
require "rgeo/geos/geos_c_impl"
=> true
> require "rgeo/geos"
=> true
> RGeo::Geos.supported?
=> true Apparently I guess that there's a moment during app initialization where this errors: begin
require_relative "geos/geos_c_impl"
rescue LoadError
# continue
end but since we're not logging anything here it's hard to say what's wrong. |
Hi @januszm sorry that there is still an issue... May you try and log the silent error to see if this is indeed the issue ? Or is it that you don't have access to any logs on the machine you are executing on ? |
@BuonOmo I've just made the following change to raise error in begin
require_relative "geos/geos_c_impl"
rescue LoadError
# continue
end with begin
require_relative "geos/geos_c_impl"
rescue LoadError => e
raise e
end and I'm getting this:
it looks like |
@januszm super interesting, this might mean that
If you could have access to the tree of your gems and look where the bundle file is installed, we might have a better lead ? |
@BuonOmo any chance this works with the following file (Amazon Linux 2023, the .bundle file was on my local Mac OS X)
If this is how it's supposed to work on Linux, then I'm wondering why the application cannot see this file in /usr/lib64 |
just for the sake of completeness, just the .so file is in
along with other extensions for other gems |
Yes, .so is the Linux .bundle! Does it make sense ? If this theory proves to be true, the next step is understanding why the two installations exists. It may be external to the gem, or it may be due to our rubygem related configurations. Sorry for the formatting, sent from my phone |
It actually looks like one installation, but C-extensions are saved in lib64 while the Ruby files alone are in share. Same applies to other gems that are installed on this system, and for some reason other gems work fine in this setup (e.g. tiny_tds or datadog agent) |
Maybe they do not Could you verify that changing the require method for @keithdoggett WDYT? |
Holy ***, changing begin
require "geos/geos_c_impl"
rescue LoadError
# continue
end > RGeo::Geos.supported?
=> true 🤯 |
@januszm yep that's just that IDK if this is the way to go since it basically says : let's look for any rgeo installation and find the first one in path. Maybe that is ok but I'd rather at least discuss it! (hence the ping in my previous message..) |
@BuonOmo WDYT about using require only as a fallback, if require_relative doesn't work? In a production-like system such as AL I'd expect to find only one version of the binary or lib anyway (automated deployments) |
Amazon Linux 2023, I can't get RGeo to work with GEOS and Ruby 3.2 after succesful compilation and installation of all necessary files:
any ideas why RGeo/Ruby still cannot see GEOS files although their in their most basic location, in /usr (not even /usr/local), all owned by root with read access.
more info from
gem install --verbose rgeo
on Amazon Linux 2023 with geos compiled, and Ruby 3.2The text was updated successfully, but these errors were encountered: