Skip to content
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

Rubyvor and Ruby 3.0 (error loading 'rexml/document') #5

Open
mike-bourgeous opened this issue Jun 25, 2021 · 0 comments
Open

Rubyvor and Ruby 3.0 (error loading 'rexml/document') #5

mike-bourgeous opened this issue Jun 25, 2021 · 0 comments

Comments

@mike-bourgeous
Copy link

Hi there!

Thanks for Rubyvor! I use Rubyvor as one of the switchable Delaunay Triangulation backends in my mb-geometry gem. While testing with Ruby 3.0.1 I found that Rubyvor depends on 'GeoRuby' (capitalized), which appears to have been superseded by 'georuby' (lowercase). Uppercase GeoRuby in turn tries to require 'rexml/document', but REXML is no longer included by default in Ruby and must be included as a gem. This causes the following error:

LoadError:
  cannot load such file -- rexml/document
# GeoRuby-1.3.4/lib/geo_ruby/simple_features/geometry.rb:181:in `require'
# GeoRuby-1.3.4/lib/geo_ruby/simple_features/geometry.rb:181:in `<class:Geometry>'
# GeoRuby-1.3.4/lib/geo_ruby/simple_features/geometry.rb:8:in `<module:SimpleFeatures>'        
# GeoRuby-1.3.4/lib/geo_ruby/simple_features/geometry.rb:2:in `<module:GeoRuby>'
# GeoRuby-1.3.4/lib/geo_ruby/simple_features/geometry.rb:1:in `<top (required)>'
# GeoRuby-1.3.4/lib/geo_ruby.rb:2:in `require'
# GeoRuby-1.3.4/lib/geo_ruby.rb:2:in `<top (required)>'
# rubyvor-0.1.4/lib/ruby_vor/geo_ruby_extensions.rb:1:in `require'
# rubyvor-0.1.4/lib/ruby_vor/geo_ruby_extensions.rb:1:in `<top (required)>'
# rubyvor-0.1.4/lib/ruby_vor.rb:8:in `require'
# rubyvor-0.1.4/lib/ruby_vor.rb:8:in `<top (required)>'

Workaround

For anyone else who uses Rubyvor, the following are possible workarounds in your own projects:

  • Add 'georuby' (lowercase) as an explicit dependency ahead of Rubyvor, so that it comes before the old 'GeoRuby' in Ruby's load path.
  • Add 'rexml' as an explicit dependency.

Possible fixes

These might work as fixes for Rubyvor:

  • Ideal: replace 'GeoRuby' with 'georuby' in the gemspec, if it's compatible with all aspects of Rubyvor
  • Alternative: Add 'rexml' to the gemspec
mike-bourgeous added a commit to mike-bourgeous/mb-geometry that referenced this issue Jun 25, 2021
Rubyvor depends on "GeoRuby", which was superseded by 'georuby'.  In
Ruby 3.0, REXML is not included by default, and GeoRuby tries to require
'rexml/document'.  This breaks tests on Ruby 3.  Adding 'georuby' as a
direct dependency places it ahead of 'GeoRuby' in the load path.

Alternative fixes if this proves unreliable:

- Open an issue with Rubyvor to switch from 'GeoRuby' to 'georuby'.
  See abscondment/rubyvor#5

- Add 'rexml' as an explicit dependency and allow Rubyvor to continue
  using 'GeoRuby'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant