Closed keithdoggett closed 1 year ago
@BuonOmo I had to pin JRuby to version 9.3.7.0. It seems there's some bug with JRuby-9.4.0.0+, but I think it's related to the core gem and not rgeo-activerecord.
It was failing on this test https://github.com/rgeo/rgeo-activerecord/blob/db3a400aea938ab9d827864a3a6e3abd3e3b9ef2/test/basic_test.rb#L34-L39
with this trace
1) Error:
BasicTest#test_as_json_projected_polygon:
NoMethodError: undefined method `first' for #<RGeo::Geographic::ProjectedPointImpl:0x1030 "POINT (0.0 0.0)">
org/jruby/RubyYielder.java:115:in `yield'
org/jruby/RubyYielder.java:120:in `<<'
org/jruby/RubyArray.java:1988:in `each'
org/jruby/RubyGenerator.java:98:in `each'
org/jruby/RubyEnumerator.java:397:in `each'
org/jruby/RubyEnumerable.java:835:in `map'
/home/runner/work/rgeo-activerecord/rgeo-activerecord/vendor/bundle/jruby/3.1.0/gems/rgeo-2.4.0/lib/rgeo/impl_helper/basic_line_string_methods.rb:200:in `validate_geometry'
/home/runner/work/rgeo-activerecord/rgeo-activerecord/vendor/bundle/jruby/3.1.0/gems/rgeo-2.4.0/lib/rgeo/geographic/projected_feature_methods.rb:175:in `validate_geometry'
/home/runner/work/rgeo-activerecord/rgeo-activerecord/vendor/bundle/jruby/3.1.0/gems/rgeo-2.4.0/lib/rgeo/impl_helper/basic_line_string_methods.rb:19:in `initialize'
org/jruby/RubyClass.java:917:in `new'
/home/runner/work/rgeo-activerecord/rgeo-activerecord/vendor/bundle/jruby/3.1.0/gems/rgeo-2.4.0/lib/rgeo/geographic/factory.rb:338:in `linear_ring'
/home/runner/work/rgeo-activerecord/rgeo-activerecord/test/basic_test.rb:37:in `test_as_json_projected_polygon'
Maybe worthwhile looking into this in the core gem, but not related to RGeo3 working with rgeo-activerecord
.
The only real note for this is that we need to force the test factories to use a ruby implemented WKT generatior.
One of the changes in RGeo3 is that we default to using the GEOS implemented WKT parser/generator in CAPI/FFI factories (https://github.com/rgeo/rgeo/pull/331), but this has slightly different outputs than the Ruby implemented generator, which has been the default in previous versions. This PR just forces the Ruby generator to be used so WKT output is consistent across all versions in the appraisal file.