rubyvor
rubyvor copied to clipboard
Rubyvor and Ruby 3.0 (error loading 'rexml/document')
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